amahabal Posted July 2, 2020 Share Posted July 2, 2020 In a workflow, I had an NSAppleScript containing this line: set thePerspective to system attribute "DESIRED" I then also added a display dialog to show the value. I was getting nothing. I added a debug before that, and sure enough, the variable was set. I then replaced NSAppleScript with RunScript with OSAScript as the language, and no other changes (except, of course, "on alfred_script" --> "on run"), and it worked fine. Any ideas what is going on here? I had assumed the two to be drop-in replacements... Link to comment
deanishe Posted July 2, 2020 Share Posted July 2, 2020 4 hours ago, amahabal said: Any ideas what is going on here? I had assumed the two to be drop-in replacements... Run NSAppleScript executes your code in Alfred's own process, on its main thread, so it shares Alfred's own environment. Run Script executes your code in a separate subprocess, so Alfred can manipulate the environment it runs in (i.e. adding workflow variables to the environment). Basically, just don't use Run NSAppleScript. Because it runs on Alfred's main thread, it blocks Alfred while the code is running (Run Script doesn't). And it behaves weirdly, too. amahabal 1 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now