I've created two droplets, one to rename files, another to print files. They are more complicated than that, but this is the essence. Sometimes we need to just rename them, sometimes just print them, and on occasion do both. I'd prefer to keep the two droplets separate because of extensive customization required for each user.
Desired workflow: drag file to RenameMe droplet, if command key is held down then pass the renamed file to the PrintMe droplet.
With the help of the checkModifierKeys script (sorry, don't have the citation handy) I can check to see if the command key is pressed, so that part of the script is taken care of. The problem is how to trigger the second droplet from the first. I've tried the opening the file with the second droplet as the application (as in the code below) but get a communication error.
Any ideas? --Alex
Sample code:
on open the_Droppings
set flPth to POSIX path of (path to me) & "Contents/MacOS/checkModifierKeys"
set cmdPressed to (do shell script (quoted form of flPth & " command")) as integer as boolean
repeat with i from 1 to (count of items in the_Droppings)
set file_name to "NEW NAME FROM SCRIPT" #actual script that generates name isn't relevant
tell application "Finder"
set name of file (item i of the_Droppings) to file_name
end tell
if cmdPressed is true then
#pass the file to the PrintMe droplet
tell application "PrintMe"
open (item i of the_Droppings)
end tell
end if
end repeat
end open