• 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: saving a file in GraphicConverter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: saving a file in GraphicConverter


  • Subject: Re: saving a file in GraphicConverter
  • From: cassj <email@hidden>
  • Date: Sun, 5 Jan 2003 22:50:09 -0500

On Sunday, January 5, 2003, at 08:11 PM, Joel Henriques wrote:

> I've been working on my droplet to save tiff files to jpeg, and with
> lots of help from everyone (especially Mr Tea) I'm getting pretty darn
> close. I can get the files to open in GraphicConverter, and the new
> destination folder for the jpegs is created, but it's not making any
> new jpeg files, or any error pop-ups. Does anyone see any obvious
> problems?
>
> property type_list : {"JPEG", "GIFf", "PICT", "TIFF"}
> property extension_list : {"jpg", "gif", "pct", "tif"}
>
> on open these_items
> tell application "Finder"
> set theLoc to container of item 1 of these_items
> set theDest to (make new folder at theLoc with properties
> {name:"JPEGs"}) as alias
> end tell
> repeat with i from 1 to the count of these_items
> set this_item to item i of these_items
> set the item_info to info for this_item
> set theName to name of (info for this_item)
> set theNewName to text item 1 of theName & ".jpg"
> if (folder of the item_info 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
> tell application "GraphicConverter"
> 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 repeat
> 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.
>
>

Joel-

I made some modifications to your script, so compare your original to
script below, but this seems to work...
I'm new to this list so I may not have replied correctly. Any guidance
would be appreciated.

-Cassj :-)

-- -----------------------------------------------------------
-- BEGIN GRAPHIC CONVERTER DROPLET
-- -----------------------------------------------------------
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
-- -----------------------------------------------------------
-- END GRAPHIC CONVERTER DROPLET
-- -----------------------------------------------------------
_______________________________________________
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.

  • Follow-Ups:
    • Re: saving a file in GraphicConverter
      • From: Joel Henriques <email@hidden>
References: 
 >saving a file in GraphicConverter (From: Joel Henriques <email@hidden>)

  • Prev by Date: Re: do shell of file on CD-ROM
  • Next by Date: Re: Finder window help...
  • Previous by thread: saving a file in GraphicConverter
  • Next by thread: Re: saving a file in GraphicConverter
  • Index(es):
    • Date
    • Thread