iTerm ist eine willkommene Alternative zu der nativen Terminal App für OSX. Jetzt kann man die auch mit AppleScript verwursten.
Wenn man es Leid ist immer wieder die selben Terminal Fenster aufzumachen um Apache-Logs zu lesen oder die Datenbank zu überwachen sollte man überlegen ob das nicht noch besser geht. Klaro geht das besser! Mit Apple-Script!
tell application "iTerm"
activate
-- create server log terminal
make new terminal
tell the last terminal
activate current session
launch session "Default Session"
tell the last session
write text "clear;"
write text "tail -f /Applications/MAMP/logs/apache_access.log"
set background color to {15000, 200, 200}
end tell
end tell
set the bounds of the first window to {0, 700, 840, 900}
set the name of the first window to "apace_access.log"
-- creat working terminal
make new terminal
tell the last terminal
activate current session
launch session "Default Session"
tell the last session
write text "welcome user, start now"
end tell
end tell
set the bounds of the first window to {0, 0, 840, 660}
set the name of the first window to "workspace"
end tell
So kann man ganze Fenster Setups zusammencoden und erspart sich so hoffentlich einen Haufen Zeit.
Nachtrag:
Man kann dann das Apple-Script auch automatisch bei jedem Start von iTerm ausführen lassen indem man es in ~/Library/iTerm/AutoLaunch.scpt ablegt. Weitere Beispiele gibt es auf der Scripting Seite von iTerm.