passing a directory to a script via drag and drop

Soldato
Joined
22 Aug 2005
Posts
8,870
Location
Clydebank
Hi all

I have a bash script which works nicely on OSX . It takes in the path supplied and then performs some actions in the directory, e.g. unraring etc.

I can run it like this in a terminal

bash-3.2$ /scripts/my_script.sh /path/to/directory

And it does stuff with $1 i.e. the first parameter

But in Windows I can just create a shortcut in sendto and then I can right click it and send the dir to the script.

How do I do that in mac osx? Even better if I Can have a dock icon I can drag the folder to.
 
Use Automator to make an action that calls the script. Drop folder onto the program you've created in Automator and BOOM.

You could also create a Servuce and call it from the right click menu.

Actually unless you're doing complex actions you could probably just do it all in Automator anyway!
 
Back
Top Bottom