3

I'm trying to copy values from one Excel sheet to another using Javascript in macOS automation. It's all ok until the number of values to copy gets rather big (like 500k) — the script hits the time limit and returns an "AppleEvent timed out" error.

From what I could find, in AppleScript it's possible to customise the default timeout time just as easily as

with timeout of 3600 seconds
    tell ....
    end tell
end with

But I couldn't manage to find such method's equivalent in Javascript.

Does anyone know if it exists and how to use it?

Thanks in advance.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
a-change
  • 656
  • 5
  • 12
  • 1
    I don't know any AppleScript but from the link provided, it seems that `with timeout` will wait for a call to finish and if it hasn't, it'd be terminated, is that correct? To be honest, I was a bit confused because the explanation mentions "AppleScript will be _tired_". – VLAZ Oct 01 '16 at 12:33
  • 3
    Go read: https://developer.apple.com/library/content/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/Articles/OSX10-10.html#//apple_ref/doc/uid/TP40014508-CH109-SW36 (with the usual caveat that I don't recommend using JXA instead of AppleScript cos it's buggy crippled crap) – foo Oct 01 '16 at 13:45

0 Answers0