2

I've got a little Python script here for batch renaming files. Really simple.

I'd like to be able to run it simply from the dock, by dragging a folder on to the icon, it will use that folder as the input for the script and run it.

Can anyone point me in the direction of a solution to this?

I've had a little look at Py2App, and will have a play in the coming days, but I'm not quite sure if it's overkill for me.

There is also the AppleScript route, but I'd like to avoid that if possible.

neff
  • 41
  • 2

1 Answers1

0

Py2app can definitely do this, make sure you enable the “argv_emulation” option to convert dragged files to command-line arguments.

That’s assuming you don’t use a GUI library, if you do look into how that library exposed file-open events as the argv_emulation code tends to be incompatible with GUI libraries.

Ronald Oussoren
  • 2,715
  • 20
  • 29