Re: Converting images from one format to another
Re: Converting images from one format to another
- Subject: Re: Converting images from one format to another
- From: Romy Opena <email@hidden>
- Date: Tue, 1 Aug 2006 17:33:18 -0700 (PDT)
Hi,
Many thanks for all the suggestions and kind offer of codes that I
can play around with.
For now, I am tinkering with what I can do using Image Events.
You guys are very helpful indeed and am sure I will find good use,
now or at some point in time, of the suggestions/tips that you made.
Cheers!
Romy
--- dev_sleidy <email@hidden> wrote:
> >Hi List,
> >
> >I am seeking ... image conversion.
> >
> >I often convert images ... in Preview. Yes, I know, it is a very
> >tedious job especially when there are many items to change. I have
>
> >no doubt that this is a very good candidate for scripting.
>
> Actually, 'Preview' itself is not scriptable); yet, it is -
> somewhat.
> For example - view 'Mik P's 10.07.2006 ('applescript-users') post
> titled 'Attivating the display dialog window', and the seven (7)
> 'Re:
> Attivating the display dialog window' replies.
>
> >... what is the next ideal solution?
>
> Either drag '.jpg' file(s) onto (saved) applet (of code below), or
> double click on applet and select folder containing '.jpg' files.
> No
> error checking provided.
>
> Sample code :
>
> on open tSelection
> my handle_Selection(tSelection)
> end open
>
> on run {}
> tell application "Finder" to set tList to every file of folder
> ((choose folder with prompt "Select a folder of graphic files to
> process") as string)
> my handle_Selection(tList)
> end run
>
> on handle_Selection(local_Selection)
> tell application "Image Events"
> launch
> repeat with i in local_Selection
> tell application "Finder" to set tExtension to (name extension
> of i)
>
> set i_String to (i as string)
> set fRef to open i_String
> save fRef as PNG in (my handle_file_name(i_String, tExtension))
> with icon
> close fRef
> end repeat
> end tell
> end handle_Selection
>
> on handle_file_name(local_String, local_Extension)
> if (local_Extension contains "jpg") then
> set {oAStId, AppleScript's text item delimiters} to
> {AppleScript's
> text item delimiters, "."}
> set tString to text items 1 through -2 of local_String
> set AppleScript's text item delimiters to oAStId
> return ((tString as string) & ".png")
> end if
> return (local_String & ".png")
> end handle_file_name
> _______________________________________________
> 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
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
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