Applescript Timeout Error
Contents |
Malasaña, Madrid Registered: 2002-11-20 Posts: 2014 What is "AppleEvent timed out"? This is an apple event error, which means that you are applescript timeout display dialog not allowed to execute more code because you are very slow.For
Applescript Try With Timeout
example, you are targeting the Finder to duplicate a folder, which has a size of 888 applescript set timeout terabytes. After it is duplicated, you wish rename the new folder to "duplicate gotta hey!". This is the code:Applescript:tell application "Finder" duplicate alias "path:to:really BIG applescript timed out folder:" set name of result to "duplicate gotta hey!" end tellThe Finder will receive the order: "duplicate!" And AppleScript will wait for a response: "done, sir!".If AppleScript gets tired of waiting for an answer, it will time out and will die throwing the error "AppleEvent timed out". So, the "set name..." line
Apple Event Timed Out 1712
won't be executed.Actually, AS 1.9.1, AppleScript gets tired after 2 minutes. However, you can prevent this from happening using the following statement:Applescript:with timeout of (30 * 60) seconds tell application "Finder" duplicate alias "path:to:really BIG folder:" set name of result to "duplicate gotta hey!" end tell end timeoutNow, AppleScript will get tired after 30 minutes!Note that this error will happen only when you are targeting a process (eg, the Finder). However, if you use the following code...Applescript:set aFolder to (choose folder with prompt "Choose a folder, please...")... If you were an irresolute folk, you could wait for 17 days before choosing a folder, and you wouldn't receive a timeout error. Filed under: Finder Offline Pages: 1 Index»Core Language»What is "AppleEvent timed out"? Board footer Jump to ScriptWire unScripted AppleScript | Mac OS X AppleScriptObjC and Xcode AppleScript Studio & Xcode Code Exchange Automator Books / Resources >>> AppleScri
event timed out" (-1712) This error can
Applescript With Timeout Example
happen when an event takes an unusually long time to complete. If an event takes http://macscripter.net/viewtopic.php?id=24461 longer than two minutes, the Apple Event Manager reports a time-out error. This error can sometimes be generated when: • You are using the FileMakerPro Show event to find records in http://www.filemaker.com/help/12/fmp/html/create_script.13.16.html a large database • FileMakerPro presents a dialog box waiting for the scripter's (user's) response • An event takes a long time to occur, such as opening a networked file when there is heavy network traffic. To prolong the amount of time AppleScript waits for a response: Use the "with timeout" statement. An example of such a statement that increases the wait time to five minutes is: tell application "FileMakerPro"with timeout of 300 secondsShow (every Record whose Cell "Product" contains "FileMakerPro")end timeoutend tell Was this topic helpful? Send feedback.
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or http://stackoverflow.com/questions/22446276/applescript-apple-event-timed-out posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Applescript - Apple Event Timed out up vote 1 down vote favorite I'm trying to open a very large excel file (*.xls) using applescript. The code is very simple, it looks like it is working, however timed out after a few minutes I receive the following message: Result: error "Microsoft Excel got an error: AppleEvent timed out." number -1712 Any idea about how to solve it? BTW using the automator doesn't work either. Here's my code tell application "Microsoft Excel" activate open "/Users/sergioguerra1/Desktop/Detektor/Etapa II/Reporte General.xls" delay 300 end tell excel applescript apple share|improve this question asked Mar 17 '14 at 3:08 user3416401 153 add a comment| 2 Answers 2 active oldest votes up vote 3 down vote accepted Try event timed out wrapping the open command in a with timeout block. eg. tell application "Microsoft Excel" activate with timeout of 3600 seconds open "/Users/sergioguerra1/Desktop/Detektor/Etapa II/Reporte General.xls" end timeout end tell This will override Applescripts default timeout of 2 mins, giving it longer to finish executing that command. More info here in the AppleScript docs. share|improve this answer answered Mar 17 '14 at 3:39 adamh 2,3221917 Thank you very much! –user3416401 Mar 17 '14 at 4:01 add a comment| up vote 0 down vote Conversely, if you are wanting to open your excel file/s without having to wait 2 minutes or longer ( eg 3600 secs) for a timeout to occur, then you may prefer to delibertely trigger the timeout sooner, and catch the error with "try" block. I've found this problem occurs when I use the "linked tables" feature in excel, and the linked table is no longer accessable. Excel pops up a nasty dialog 1/2 way through the "open" command and just hangs till you type ESC twice ( or similar ) eg: try with timeout of 10 seconds open some_excel_File end timeout on error -- excel timeout probably due to linked tables -- if the file has "linked tables" we need to hit esc twice after opening it. tell application "System Events" repeat 2 times key code 53 delay 3 end repeat end tell end try share|improve this answer answered Mar 2 '15 at 0:17 Buzz 111 add a