Re: Need help with image events droplet to save multiple files as png
Re: Need help with image events droplet to save multiple files as png
- Subject: Re: Need help with image events droplet to save multiple files as png
- From: Adam Bell <email@hidden>
- Date: Wed, 4 Jan 2006 11:38:45 -0400
If the object dropped is a file, this double dots the png: ..png. If a folder, it's ok
On 1/4/06, Michael Cytrynowicz <
email@hidden> wrote:Hi - Many thanks to Kai, Mark, Deivy (Santista), Luther, Yvan and
Adam for the help!
Kai and Mark reminded me that I needed to pass New_file_path, defined
in one handler, to the other handler. Lesson learned!
Deivy pointed to a mistake in my counting the characters.
Luther contributed a script that did something else that I also
wanted (re-saving files in their original types so that I could get a
newer, better icon / preview).
Yvan pointed to a _very_ useful and educational folder action - and
Adam told me where to find it!
Thanks again, guys!
And the final script is below, after the one contributed by Kai.
A final note: when running the script an intermediate .sips file is
briefly created then disappears. Hmmm...
Going to the terminal with "sips --help" opens up a number of very
interesting possibilities.
No, wait, I need to finish my work. Hmm Hmm...
mike
------------------------------
save as png droplet
------------------------------
on open these_items
repeat with this_item in these_items
--if (folder of the this_item is false) and (alias of the item_info
is false) and ((the file type of the item_info is in the type_list)
or the name extension of the item_info is in the extension_list) then
process_item(this_item)
--end if
end repeat
end open
on process_item(this_item)
set new_path to text 1 thru -5 of (this_item as Unicode text) & ".png"
--set the new_path to ((text 1 thru ((offset of "." in (reverse of
(characters 1 thru -1 of this_item)) as string) * -1) of this_item) &
"png")
tell application "Image Events"
launch
set thisImage to open this_item
--scale thisImage to size 300
save thisImage as PNG in new_path with icon
close thisImage
end tell
end process_item
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (
This email sent to email@hidden
--
Some minds remain open long enough for a truth to both enter and leave without processing.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden