Re: Save in Image Events
Re: Save in Image Events
- Subject: Re: Save in Image Events
- From: Matt Neuburg <email@hidden>
- Date: Wed, 14 Dec 2005 14:13:17 -0800
- Thread-topic: Save in Image Events
On Wed, 14 Dec 2005 10:57:43 -0600, Luther Fuller <email@hidden>
said:
>I have been trying to write a script to convert image files this
>morning. After spending too much time getting it to work, I was
>successful, but noticed some problems with the 'save' command. Here's
>a simplification of the script:
>
> tell application "Image Events"
> launch
> set theImage to open fileAlias
> save theImage as TIFF in destFolder -- for example
> -- other types have the same problems
> close theImage
> end tell
A good idea is to start with working code. Here's the example from my book:
tell application "Image Events"
set f to (path to desktop as string) & "bigImage.tiff"
set f2 to POSIX path of (path to desktop) & "/smallerImage.tiff"
set im to open file f
scale im by factor 0.5
save im in f2
end tell
Go thou and do likewise. Also see the discussion in my book where I warn
that you should never believe the claim in a dictionary that "save" takes an
alias, since that would be impossible if you're creating the file (you can't
have an alias to a file that doesn't exist). m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
_______________________________________________
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