Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script to run a command in new Terminal window works un-reliably.



At 11:58 -0400 7/27/06, Andrei Tchijov wrote:
>Hi,
>  Could some one take a look at the script below and tell me what could be wrong with it?  The goal is to create new Terminal window and run a command in it.  The script works most of the time, but once in a while, it will fail to do "run command" bit. 
>
>  Your comments will be highly appreciated.

I have a lot of those, once in a while, problems with scripting of Terminal. It appears as though, if you give terminal too much, in its opinion, to perform at one time it can quietly forget your instructions.

It's possible to name a terminal window so you can go back to it and not have Terminal forget about an environment you have set up (the way do shell script does.)

tell application "Terminal"
	do script "cd somewhere"  in window "theFirst"
	do script "curl someURL -O"  in window "theFirst"
end tell

(Off my head and without syntax checking) is quite likely to change the directory and simply return.

For some examples of what I have had to do (with proper syntax) :

<ftp://ftp.macnauchtan.com/Software/Progress/>
<ftp://ftp.macnauchtan.com/Software/Progress/tViewInit>
-- 

Applescript syntax is like English spelling:
Roughly, though not thoroughly, thought through.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden

References: 
 >Script to run a command in new Terminal window works un-reliably. (From: Andrei Tchijov <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.