• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Need help with image events droplet to save multiple files as png
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Michael Cytrynowicz <email@hidden>
  • Date: Tue, 3 Jan 2006 23:15:19 -0800

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 (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: Need help with image events droplet to save multiple files as png
      • From: Adam Bell <email@hidden>
  • Prev by Date: Re: How do I delete the 1st three characters from a variable
  • Next by Date: Re: get size of available screen fails
  • Previous by thread: Re: get size of available screen fails
  • Next by thread: Re: Need help with image events droplet to save multiple files as png
  • Index(es):
    • Date
    • Thread