Verifica se funziona.
Scarica Ottieni l'azione automator del primo Finder Window Path BETA 10.9 dal mio blog: my_very_first_automator_action
L'azione restituisce il percorso della finestra in primo piano del cercatore. Non prende alcun input dalle azioni sopra. Il post spiega tutto: -)
Crea un nuovo documento dell'applicazione in Automator e aggiungi il Trova il primo percorso della finestra del Finder . Quindi aggiungi semplicemente Esegui script di shell dopo.
Salva come applicazione. E poi fai il drag and drop.
Lo testerei con il tuo codice ma non ho la presentazione python ...
Nota della documentazione Apple in merito alle Azioni di terze parti.
Installing Actions When your action has been thoroughly debugged and
tested, build a deployment version of the bundle (using the proper
optimizations). Then create an installation package for the action (or
add the action to your application’s installation package). The
installer should copy the action to /Library/Automator or
~/Library/Automator, depending on whether access to the action should
be system wide or restricted to the installing user.
Instead of installing your action separately, you can put it inside
the bundle of your application, especially if the action uses the
features of that application. When Automator searches for actions to
display, it looks inside registered applications as well in the
standard Automator directories. The advantage of packaging your
actions inside an application is that you don’t need to create a
separate installation package to install the actions. To install the
actions, users need only drag the application to a standard location.
Action bundles should be stored inside the application wrapper at
Contents/Library/Automator. Thus, if your action is MyAction.action
and your application is MyApp.app, the path inside the application
would be:
MyApp.app/Contents/Library/Automator/MyAction.action
You can either manually copy an action into this location (after
creating the necessary subdirectories) or you have Xcode copy it using
a Copy Files build phase. If you copy an action into an application
bundle but the application is already installed on a system, you must
get Launch Services to recognize that the application has new content
to register (that is, the new action) by changing the application’s
modification date. You can do this by entering the touch command in
the Terminal application.
sudo touch /Applications/MyApp.app
Or you can rename the application in Finder to something else, change
it back to the original name, and then launch the application once.