• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Terminal Scripting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Terminal Scripting


  • Subject: Re: Terminal Scripting
  • From: Graff <email@hidden>
  • Date: Fri, 27 Feb 2004 19:34:17 -0500

Ok, because Terminal doesn't seem to support the standard suite of AppleScript commands I found myself unable to create new windows within it. I have found a workaround however. Just run an empty script, that will cause a window to open in front of all other windows:
do script ""

So this script should do what you want:
--------------
tell application "Finder"
set dname to POSIX path of ((folder of (path to me)) as string)
end tell

tell application "Terminal"
set scriptCommand to "cd " & dname
do script ""
do script "echo \"123\"" in front window
do script scriptCommand in front window
end tell
--------------

- Ken

On Feb 27, 2004, at 5:25 PM, Kris Jensen wrote:

I'm trying to:

- make a new Terminal window
- change directories
- start a terminal-based application

Based on various things I've read in the mailing list archives, I've tried this just to get a new window and change directories:

tell application "Finder"
set dname to POSIX path of ((folder of (path to me)) as string)
end tell

tell application "Terminal"
set scriptCommand to "cd " & dname
activate
do script "echo \"123\""
delay 2
do script scriptCommand in window 1
end tell

But it doesn't work. I don't get a new window.

The event log (for the Terminal section of the script) looks like:

tell application "Terminal"
activate
do script
do script in window 1
end tell

Do I have an obvious (or not so obvious) error?
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Terminal Scripting
      • From: Martin Orpen <email@hidden>
References: 
 >Terminal Scripting (From: Kris Jensen <email@hidden>)

  • Prev by Date: Re: Terminal Scripting
  • Next by Date: Re: Terminal Scripting
  • Previous by thread: Re: Terminal Scripting
  • Next by thread: Re: Terminal Scripting
  • Index(es):
    • Date
    • Thread