Jump to content

Rename `Run NSAppleScript`


vitor

Recommended Posts

A mistake we see (too) often is people using Run NSAppleScript when they should be using a Run Script with language set to /usr/bin/osascript (AS). Not that we always know why their code fails when using the former, but we recommend the latter because it fixes the issue more often than not.


Most bug reporters choose Run NSAppleScript, I believe, because they see “AppleScript”—ignoring the “NS”—when looking to run a script and go with it. We repeat “you should only use Run NSAppleScript if you know you need it” (or “if you know what you’re doing”), so it should be findable by people who need it, but used as infrequently as possible by those who don’t.


My suggestion: rename Run NSAppleScript to Run in Thread or literally anything else that removes the word “AppleScript” from there. I’m confident there will be fewer bug reports with that.


The language dropdown in Run Script could be changed to /usr/bin/osascript (AppleScript) and /usr/bin/osascript (JavaScript) to further clarify.

Link to comment
Share on other sites

I'm happy to make this change, but I still believe the Run NSAppleScript has it's place for single shot tasks when the "compiled" option is selected, as it's way faster.

 

Can you think of any other names rather than Run in Thread? as that isn't descriptive enough.

Link to comment
Share on other sites

58 minutes ago, Andrew said:

as it's way faster

 

True, but not in a way that really matters, imo, because it's not used for interactive elements (Script Filters).

 

I suspect that if it didn't exist and someone suggested it today, it wouldn't make the cut. Especially because of its ability to lock up Alfred.

 

1 hour ago, Andrew said:

Can you think of any other names rather than Run in Thread? as that isn't descriptive enough.

 

Probably something in line with the way you described it: Quick Script or something like that.

 

But my personal preference would be "Run NSAppleScript (deprecated)". It does seem to cause more problems than it solves.

Link to comment
Share on other sites

7 minutes ago, deanishe said:

Run NSAppleScript (deprecated)

 

Nice idea... perhaps I may even just create a "Legacy" group in the popup menu to put things which are only there for backwards compatibility, such as Run NSAppleScript, and the Filter utility.

Link to comment
Share on other sites

5 hours ago, Andrew said:

Nice idea... perhaps I may even just create a "Legacy" group in the popup menu to put things which are only there for backwards compatibility, such as Run NSAppleScript, and the Filter utility.

 

I might suggest that you consider using consistent language. "Deprecated" is used in the Appearance UI. "Deprecated" and "Legacy" aren't exactly equivalent, but it seems like Alfred should have an opinion about how to label features may be retired in subsequent releases.

 

image.png.bbac640a878897fc95fb3e45a9875777.png

Link to comment
Share on other sites

12 hours ago, Chris Messina said:

I might suggest that you consider using consistent language. "Deprecated" is used in the Appearance UI. "Deprecated" and "Legacy" aren't exactly equivalent, but it seems like Alfred should have an opinion about how to label features may be retired in subsequent releases.

 

This is the reason I would label it Legacy, as the workflow objects aren't being retired, and they will continue to be maintained. They have simply been superseded with alternatives. The filter object even notes itself as a Legacy Object:

 

filter legacy.png

 

With the window blur, this is actually deprecated, as it is using an Apple API which will almost certainly stop working at some point, and at that point, the feature will be removed from Alfred.

Link to comment
Share on other sites

Ok, for now, I've just beefed up the messaging within the Run NSAppleScript object:

 

apple-script.png

 

I've also renamed the script paths to include (AppleScript) and (Javascript) respectively. For now, I don't want to create a new Legacy (or whatever) group and move objects around, but this is something I'll keep in mind for a more major release.

 

I've also updated the help page from the (?) button to highlight the blocking:

https://www.alfredapp.com/help/workflows/actions/run-nsapplescript/

 

This is now in the 4.5.1 b1255 pre-release.

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...