RE: Applescript-users Digest, Vol 3, Issue 120
RE: Applescript-users Digest, Vol 3, Issue 120
- Subject: RE: Applescript-users Digest, Vol 3, Issue 120
- From: "Scott Babcock" <email@hidden>
- Date: Thu, 2 Mar 2006 13:11:43 -0800
- Thread-topic: Applescript-users Digest, Vol 3, Issue 120
If you're calling osascript through 'do shell script' from another
AppleScript script, you're probably running into the default Apple Event
timeout of 2 minutes. If this is the case, AppleScript should be
throwing a timeout error, but you may be catching the error in a 'try'
block and ignoring it.
To specify a longer timeout, wrap your 'do shell script' call in a
timeout block:
-- allow 10 minutes
with timeout of 600 seconds
do shell script "osascript pathToScript"
end timeout
You could also use the 'run script' event instead of using osascript
through 'do shell script'. You may still need the timeout block, though.
> Date: Tue, 28 Feb 2006 15:23:06 -0500
> From: Jeramey Valley <email@hidden>
> Subject: osascript time to execute
> To: email@hidden
> Message-ID: <p0600204bc02a5ee78bf6@[10.182.100.114]>
> Content-Type: text/plain; charset="us-ascii" ; format="flowed"
>
> In a logout script, I was calling osascript to run multiple compiled
> applescripts. Under the current test machine, problems were
> encountered that the tasks appeared to be failing, but was unable to
> see why since the scripts run just fine via script editor or when
> invoked by osascript. OS is 10.4.4. Even put tons of logger steps in
> so I could see what was failing or at least when it was failing.
>
> Question: When running a script via osascript command, is there a
> timeout value or similar that will simply end the process regardless
> of where it is in the steps? This is the only explanation I can come
> up with.
>
> In the logout script, if I call the script via osascript, there are a
> few of the log entries in the syslog, but they stop part way through
> the script's execution, at points that should not fail or otherwise
> cause the script to stop.
> If I save the compiled script as an application and call that,
> instead, from the login script, then everything works as expected.
> This leads me to believe that osascript is told what to do, but the
> calling script is not waiting for osascript to finish. Since this is
> a logout script, the logout script "finishes" and the OS shuts down
> all running processes - this is killing the scripts I call from
> osascript part way through completion.
>
> Any of this make sense? Any solutions?
> --
>
> Regards,
>
> Jeramey Valley
> email@hidden
> Network Administrator
> H. H. Dow High School
> Midland Public Schools
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden