How can I run a PHP script by dropping file on icon? I have a php script that takes a filename as an argument. When I run it from a terminal window I type

./my_script.php file_to_process.txt


It works great!

What I would like to be able to do is to have an icon on my dock that when I drop a file onto it, it would excute the php script and supply the complete path to the dropped file as an argument to that script.

Is this possible? 
Can you please provide step by step instructions?
Yes, this should be possible using Automator. I haven't worked with php from the command line, so I'm unsure exactly how that works, but this is a general instruction.


Open Automator (It's in the Applications folder).
Choose to create an Application.

Select Utilities under Library and choose Run Shell Script and drag it to the area on the right.

In the text area for the run shell script action, remove 'cat' and write the full path to the script you wish to run.
Select to Pass input to stdin.
Save the Application somewhere and drag it to your dock.
Try it out by dragging a file to it.