Re: Saving new image from GraphicConverter 4
Re: Saving new image from GraphicConverter 4
- Subject: Re: Saving new image from GraphicConverter 4
- From: Richard 23 <email@hidden>
- Date: Sun, 21 Jan 2001 01:41:24 -0800
>
Message: 12
>
Date: Sat, 20 Jan 2001 23:46:22 -0500
>
From: Jeremy Reichman <email@hidden>
>
Subject: Saving new image from GraphicConverter 4
>
To: email@hidden
>
>
I'm trying to take an existing image in GC4, modify it, and save it as a new
>
image.
>
>
The GC4 dictionary indicates that I should use something like:
>
>
save [reference] in [alias] as [format] with makeCopy
>
>
Everything works fine until I add in the "in [alias]" bit. There, I try to
>
make an alias to a new file/location. GraphicConverter returns an error that
>
that file cannot be found. However, if I leave that out, even turning on the
>
makeCopy option (which is supposed to save a copy of the file, rather than
>
overwriting the original), it will overwrite the original file. Not what I
>
want in either case -- I want automated production of a new image file.
>
>
Any ideas on how I can get this to work, or if I can even do it in GC4?
At first I thought I was just going to say that the dictionary was
misleading,
that it meant file specification and providing it with the path to a new
(not
yet existing) file, of course GraphicConverter would save a copy.
But this is not the case. Unbelievable!
Although you can use the term "file" instead of "alias" it seems the file
really does already have to exist. This seems silly and I hope someone
can find a better way. But here's my practical (because it works)
solution:
-- ---------------------------------------------------------
-- Preprocessed by Convert Script 1.0d2
-- ---------------------------------------------------------
set destFolder to "Private:"
set destName to "z"
set destPath to destFolder & destName
tell application "GraphicConverter"
set theFile to file of window 1
tell application "Finder" to if not (exists file destPath) then ==>
set name of (duplicate theFile to folder destFolder) to destName
-- save window 1 in file (destPath) as PICT with makeCopy
save window 1 in alias (destPath) as PICT with makeCopy
end tell
-- ---------------------------------------------------------
Successful or not, the save command returns 0.
Oh well.
R23