Re: saving a file in GraphicConverter
Re: saving a file in GraphicConverter
- Subject: Re: saving a file in GraphicConverter
- From: Joel Henriques <email@hidden>
- Date: Sun, 5 Jan 2003 20:21:58 -0800
I really like the way that's scripted. Solved some problems with
existing folder causing an error, but I'm still not getting it to
create a jpeg file. Maybe I've got something set wrong with my setup?
I'm still very, very new at this. It seems like everything makes sense
in the script though. Hum.....
>
property type_list : {"JPEG", "GIFf", "PICT", "TIFF"}
>
property extension_list : {"jpg", "jpeg", "gif", "pct", "pict", "tif",
>
"tiff"}
>
>
on open these_items
>
tell application "Finder"
>
activate
>
>
set theLoc to container of item 1 of these_items
>
>
set folderexists to (folder "JPEGs" of theLoc) exists
>
if folderexists is false then make new folder at theLoc with
>
properties {name:"JPEGs"}
>
set theDest to folder "JPEGs" of theLoc as alias
>
set itemcount to the count of these_items
>
>
repeat with i from 1 to itemcount
>
set this_item to item i of these_items
>
set validfiletype to (the file type of this_item is in the
>
type_list)
>
set validnameextension to the name extension of this_item is in the
>
extension_list
>
>
if validfiletype and validnameextension then -- else process next
>
file
>
>
set theName to the name of item i of these_items as string
>
>
set AppleScript's text item delimiters to "."
>
set theNewName to text item 1 of theName & ".jpg"
>
>
set validfiletype to (the file type of this_item is in the
>
type_list)
>
set validnameextension to the name extension of this_item is in
>
the extension_list
>
>
if validfiletype and validnameextension then
>
tell application "GraphicConverter"
>
activate
>
open this_item
>
set this_item to ((theDest as string) & theNewName)
>
save window 1 in this_item as JPEG with makeCopy
>
close window 1 saving no
>
end tell
>
end if
>
end if
>
end repeat
>
end tell
>
end open
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.