Send arguments to script menu scripts?

I have a number of python and schell scripts which work fine in the Terminal. They process any file(s) given as arguments. I can wrap them up as Automator actions, and they work fine.


But Apple's support pages say that the Script menu can run any executable -- shell scripts, python, Ruby, applications, as well as AppleScripts and Automator workflows.

However, when I try to use the bare script, it doesn't get passed the currently selected files, even when run as a "Finder" script. Is it possible? Or must I use the Automator wrapper?


Yes, I could use the Services menu, except that it doesn't sort the scripts alphabetically and you can't use subfolders.

Answered by red_menace in 291621022

The Script Menu will indeed run just about anything, but nothing is passed (the same is true for an application placed in the Finder's toolbar). If you are wanting to get the current selection in a Finder window, you are going to have to get it from the Finder (e.g. via an AppleScript).

Accepted Answer

The Script Menu will indeed run just about anything, but nothing is passed (the same is true for an application placed in the Finder's toolbar). If you are wanting to get the current selection in a Finder window, you are going to have to get it from the Finder (e.g. via an AppleScript).

Thanks. I've now worked out how to get a Finder selection into python!

Send arguments to script menu scripts?
 
 
Q