FWeinb / node-osascript

Use AppleScript from node
68 stars 9 forks source link

osascript (Not Responding) #4

Closed przemyslawpluta closed 6 years ago

przemyslawpluta commented 9 years ago

Is there an options for script timeout? At the moment if this state occurs - osascript (Not Responding) visible in the Activity Monitor there is no response or error emitted back?

FWeinb commented 7 years ago

I would welcome this feature too. Not much time but would review a PR for this.

seblavoie commented 7 years ago

I would love if this could be an option. I am not sure how to implement this, but if you have some general directions to give me explaining where I should look at to get going, I'd love to help you with this.

seblavoie commented 7 years ago

You can get a part of the solution by modifying the Applescript timeout value which will throw an Apple Event Timed Out error in the package. Seems like the default is 2 minutes. You can change it which this code:

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 timeout

More information here: http://macscripter.net/viewtopic.php?id=24461

AckerApple commented 6 years ago

I have made a pull request that allows node to kill the AppleScript.

Pull Request #14

AckerApple commented 6 years ago

My pull request has been accepted and merged. You could close this issue now.

How to timeout is in the readme docs