Marcel Eichner // Ephigenia

  • Home
  • Illustration
  • Code
  • Kontakt

Aktuelle Projekte

Horrorblog.org
jQuery.slideShow
Franklin
code.marceleichner.de

This Blog-Website is built with Harrison!

Blogs & Freunde

Gimmixx
Martin Fleck
Torsten Bergler
Jens Franke
Robokid
Peter Kröner
Polycoder
Coding Horror
Lotterliebe
CodeBalancer
Pseudocoder
Migrador
Dachdeckermeister Peter Arold in Werda, Plauen, Hof und Umgebung La Petite Provence - Pension und Festsaal in Leisnig Piv-Berlin, Immobilienverwaltung Verwaltung Berlin blogoscoop

#457

05.06.2009 13:49
0 Kommentare
Share
  • code
  • osx
  • App
  • terminal
  • tool
  • script
  • scripting
  • apple
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.
marceleichner HTML5 Harrison Theme (Validate Source), © 2010 by Ephigenia M. Eichner, Impressum