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 comment
Share on other sites

 

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 comment
Share on other sites

  • 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 comment
Share on other sites

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 comment
Share on other sites

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 comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...