Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I need to make a bash script to that I can drag a .rar file on top of it and then the script will receive the pathname of that file as argument 1 ($1). I have made the bash script, but how do I make it to be an application (right now MAC OSX is treating it as a text file even though I did chmod +x) and how do I enable the drag-n-drop of a file?

Best Regards,

Mads Ravn

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

You should be able to turn your script into an application with Automator - Applications -> Utilities -> Automator.app. Look for an option called "Run Shell Script" and once you're done, it should behave like other apps in that anything that is dragged and dropped on it will be run with it. Good luck!

share|improve this answer
    
Thanks a lot. That did it. –  Mads May 13 '13 at 18:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.