See if this works.
The action returns the path of the front most finder window. It does not take any input from above actions. The post explains it all :-)
Save as Application. And then do the drag and drop.
I would test it with your code but I do not have the python slideshow...
Note from Apple documentation in regard to Third party Actions.
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.
Best Answer
The following AppleScript should work, which you can save as an application and put in your Finder toolbar.