Jump to content

NSAppleScript ignoring delay


nightofgrim

Recommended Posts

This seems odd to me. As an example I made a workflow that runs an NSAppleScript like so:

 

on alfred_script(q)
  delay 10
  display dialog "hello world"
end alfred_script
 
 
The dialog appears immediately without the delay. When I run this script in the AppleScript editor it works fine.
 
Of course I'm not intending to make a workflow that makes a 'hello world' dialog, but what I am trying to do requires delay to work.
Link to post

 

This seems odd to me. As an example I made a workflow that runs an NSAppleScript like so:

 

on alfred_script(q)
  delay 10
  display dialog "hello world"
end alfred_script
 
 
The dialog appears immediately without the delay. When I run this script in the AppleScript editor it works fine.
 
Of course I'm not intending to make a workflow that makes a 'hello world' dialog, but what I am trying to do requires delay to work.

 

 

That is interesting. Even more so that I got it to work correctly the first time. I'll check with Andrew and see if knows anything about this. As a workaround, instead of using NSAppleScript, if you add a "Run Script" and set the language to osascript, it seems to work as expected.

Link to post
  • 5 months later...

That is interesting. Even more so that I got it to work correctly the first time. I'll check with Andrew and see if knows anything about this. As a workaround, instead of using NSAppleScript, if you add a "Run Script" and set the language to osascript, it seems to work as expected.

Also had this issue. Any comments on this?

Link to post

This IS interesting.  When I set to run NSApplescript the result is random at best.  I set the workflow to run from a hotkey.  Each time, the number of seconds that passes before the dialog appears is random, from instant, to the required 10 secs.

 

When I set the hotkey to run the action 'script' and set to osascript as David suggests, it, so far, has been waiting the required amount of time before the dialog pops up.

Link to post

This IS interesting.  When I set to run NSApplescript the result is random at best.  I set the workflow to run from a hotkey.  Each time, the number of seconds that passes before the dialog appears is random, from instant, to the required 10 secs.

 

When I set the hotkey to run the action 'script' and set to osascript as David suggests, it, so far, has been waiting the required amount of time before the dialog pops up.

exactly! Iam now using walkaround latter method...

Link to post

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...