Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Run custom action in terminal/iTerm2

David Rees February 1, 2013

Is there a way to have a custom action run in the terminal/iTerm? Optimally in the same terminal window each time (so I have an ongoing history in that iTerm window)?

1 answer

1 accepted

2 votes
Answer accepted
KieranA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 3, 2013

Yup, this can be done using Apple Script.

There's a little guide you can follow here to make the script. I just saved it into my Documents folder. Within the script I just did:

do shell script "open -a iTerm"

Then in SourceTree the "script to run" field for the custom action has "osascript" in it, and the "parameters" field has "/Users/Kieran/Documents/iterm_as.scpt" in it.

Of course you can go much further than this with your Apple Script passing extra parameters to iTerm - this is just a starting point really. And finally, yes, it will open in the same iTerm window each time much like the console.

Hope that helps

David Rees February 4, 2013

Thanks. I actually want to run a command though, but your help plus http://code.google.com/p/iterm2/wiki/AppleScript will get me where I can to go I think. Thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events