I have a convoluted script that will do what I want, but I am curious why an alternate form of the script will not work. This is the one that DOES work:
on adding folder items to this_folder after receiving these_items
set item_string to ""
repeat with i from 1 to number of items in these_items
set this_item to item i of these_items
set the item_info to info for this_item
set the item_string to item_string & the quoted form of the POSIX path of this_item & " "
end repeat
do shell script ("open -a GraphicConverter " & item_string)
end adding folder items to
This is the one that doesn’t work, although I don’t understand why…
on adding folder items to this_folder after receiving these_items
tell application "Finder"
open these_items using "GraphicConverter"
end tell
end adding folder items to
I get a compile error that highlights the word “using” and says it expected the end of the line but found an identifier instead.
While I’m asking, is it possible to prevent dropped items from actually being moved or is there a way to return them to their previous location(s)? Perhaps I want something other than a folder action, but I like the fact that it’s a folder action because of the contextual menu showing the contents…
Instead of telling Finder to open the files, why not do:
tell app "GraphicConverter
open these_items
end tell
As for making the file return to it’s location, you could make the folder action find out the path to the item at the start of the script, and move it back to there at the end of the script, but to me it sounds like you want a droplet.