Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Opening a Terminal window in AppleScript

Hello, I am having dificulties getting a terminal window to open from an AppleScript. I recently upgraded from OS X SnowLeopard to Lion. Under SnowLeopard the following AppleScript would activate Terminal and open a Terminal window:


tell application "Terminal"

activate

end tell


However, now that I am using Lion, when I run the above script Terminal will activate but a Terminal window does not open. Does anybody know how to modify this script so that Terminal activates and a Terminal window opens? Thanks George

Mac Pro, Mac OS X (10.6.8)

Posted on Sep 17, 2011 8:17 AM

Reply
Question marked as Best reply

Posted on Sep 17, 2011 9:07 AM

Hello, I figured out the answer. I just needed to tell the applescript to open a new window using the system events command. Here is the revised script:


tell application "Terminal"

activate

tell application "System Events" to keystroke "n" using {command down}

end tell


Thanks, George

1 reply
Question marked as Best reply

Sep 17, 2011 9:07 AM in response to BioASys

Hello, I figured out the answer. I just needed to tell the applescript to open a new window using the system events command. Here is the revised script:


tell application "Terminal"

activate

tell application "System Events" to keystroke "n" using {command down}

end tell


Thanks, George

Opening a Terminal window in AppleScript

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.