Wait until done is giving a timeout error after two minutes.

174 views
Skip to first unread message

Michael Powers

unread,
Dec 16, 2013, 6:29:40 PM12/16/13
to fak...@googlegroups.com
I have an AppleScript which calls a fake workflow to pass variables to a browser-based practice management system. I want the AppleScript to wait until the workflow is done and then trigger a log script. Everything is working fine except for when the workflow is running it runs for two minutes and then gives a timeout error.  This is the AppleScript segment that I'm using.  I'm including the BB edit log relevant portion. And the error message. Do you know what I'm doing wrong? Any help would be appreciated thank you.

Michael Powers

tell application "Fake"

open "/Users/therapy/Library/Workflows/FakeWorkflows/PassVariables.fakeworkflow"

run workflow

wait until done with timeout (60 * 15)

display dialog "done"

tell application "System Events"

tell process "Fake"

keystroke "w" using command down

end tell

end tell

end tell


This  is a copy of my BB edit log showing the progress.

open "/Users/therapy/Library/Workflows/FakeWorkflows/PassVariables.fakeworkflow"
run workflow current application
wait until done current application with timeout 900

The error is: the AppleEvent Timed out (errAETimeout:-1712)

Michael Powers

unread,
Dec 27, 2013, 4:09:09 PM12/27/13
to fak...@googlegroups.com
I have done some poking around and it seems that this problem is a limitation of AppleScript. It gets tired of waiting after two minutes. I did find a work around on Mac scripter. The solution is to add this first line and the ending line which will cause applescript to wait for 30 min:

with timeout of (30 * 60) seconds

     tell application "Fake"

     open "/Users/therapy/Library/Workflows/FakeWorkflows/PassVariablesNext.fakeworkflow"

     run workflow

     wait until done

     display dialog "done"

     tell application "System Events"

     tell process "Fake"

     end tell

    end tell

     end tell

end timeout

Reply all
Reply to author
Forward
0 new messages