Re: Scripting dropping a file onto a droplet
Re: Scripting dropping a file onto a droplet
- Subject: Re: Scripting dropping a file onto a droplet
- From: Brian <email@hidden>
- Date: Fri, 13 Apr 2001 22:18:21 -0400
Thanks to all who helped me figure this out!!!!! Despite Adobe's limited
Applescript support this script to run an Image Ready droplet externally
works! See code below.
A few questions remain, though.
the line:
set the label index of every item of this_folder to 3
still troubles me. My intention is to choose from a folder files which are
new (not yet labeled) and after acting on those files label them.
Because I haven't yet figured out the syntax I revert to labeling all of the
items in the folder after the body of the script runs. Since this script
will be attached to a folder on a network volume with several users saving
into it there's definitely the chance that while the script is running new
items could be added and subsequently get labeled without having been acted
upon.
My plan was to use something like:
set the label index of every item of ToDo_list to 3
but the syntax isn't right.
Any suggestions?
Also the repeat loop that opens every file fires up the droplet many times
which doesn't seem to hurt anything but may well hurt performance? Any
thoughts?
Again many thanks-
I think I'm beginning to like Applescript!
brian
Code follows:
(*
Intended to be used by saving as a compiled script and attach as a folder
action
*)
on adding folder items to this_folder after receiving added_items
tell application "Finder"
(* the command I want to use in my droplet is "Optimize to file size", which
returns an Image Ready error if there isn't an open document. Basically
says that command isn't available. I've communicated the error to Adobe
tech support and their workaround is - always have an image open in Image
Ready before trying to execute a droplet with that command, hence this
otherwise unnecessary open*)
open file "blank.jpg"
set ToDo_list to every item of this_folder whose label index is not 3
repeat with i in ToDo_list
set i to i as alias
tell application "Finder" to open file i using file "YOUR DROPLET'S NAME"
end repeat
set the label index of every item of this_folder to 3
end tell
end adding folder items to