First of all I am really quite clueless when it comes to AppleScript. Most of my scripting comes from cutting and pasting from different examples I find online. I really have no idea what I am doing, so forgive me if what I so far is complete wrong. Anyways, I spent a great deal searching and found a lot of things close to what I am trying to do, but nothing exactly.
This seems like it should be pretty simple. All I want to do is have a variable that gets set to the name of the file that is dragged onto the script and then launch a shell script with that files name as an option.
For example lets say I have a unix program called animal and I have a file called dog.bin
I want to be able to drag the dog.bin file onto the script and have a shell script launch animal with dog as an option
Here is what I have so far.
on open draggeditem
set filename to name of draggeditem
do shell script “$HOME/desktop/animal -” & filename
end open
This is supposed to produce animal -dog.bin but instead I get an error that says Can’t get name of {alias "MacintoshHD:Users:bewell:Desktop:dog.bin}.
I sure this is easy and any assistance would be much appreciated.