user32004
user32004

Reputation: 2403

Applescript to open specific Terminal Style Windows

Ok, so the thing is. I want to have different style terminal windows for each job. Each one will have a different job, i.e. , one will connect through ssh to a site, other window to other place, etc.

So I guess this could be done with some Applescripting?

The thing would be to have some applescripts that opens a different terminal window. And then add each applescript to a shortcut.

Any ideas?

Thanks :)

Upvotes: 4

Views: 3476

Answers (2)

Lri
Lri

Reputation: 27613

tell application "System Events" to tell process "Terminal" to click menu bar 1's menu bar item "Shell"'s menu 1's menu item "New Window"'s menu 1's menu item "Grass"


tell application "Terminal"
    set win to do script
    set win's current settings to settings set "Basic"
end tell

Upvotes: 3

Kassym Dorsel
Kassym Dorsel

Reputation: 4843

How about setting up a Window group in terminal ?

Open all Terminal windows you want --> Shell --> Show Inspector. Under Settings you can change the theme of each terminal window.

Window --> Save Windows as Group

In preferences set the startup option to display the group.

http://img18.imageshack.us/img18/9681/screenshot20111018at110.png http://img542.imageshack.us/img542/9681/screenshot20111018at110.png

If you want to use Applescript to set a window's theme you first need to get the id's of all the themes you have using this applescript :

set a to {}
tell application "Terminal"
    repeat with i from 1 to count settings set
        set temp to {settings set i's name, settings set i's id}
        set end of a to temp
    end repeat
    a
end tell

This will output an array of id # and the theme's name. Next to create a new window use the following :

tell application "Terminal"
    set a to do script "" -- creates new window
    set a's current settings to (settings set id <one of the id #>)
end tell

Upvotes: 3

Related Questions