1 Reply Latest reply: Sep 17, 2011 9:07 AM by BioASys
BioASys Level 1 Level 1 (0 points)

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)
  • BioASys Level 1 Level 1 (0 points)

    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