• 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: Resizing image in image events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Resizing image in image events


  • Subject: Re: Resizing image in image events
  • From: kai <email@hidden>
  • Date: Sat, 13 May 2006 00:49:36 +0100


On 12 May 2006, at 18:47, Michelle Steiner wrote:

On May 12, 2006, at 10:34 AM, Peter Waibel wrote:

Try to use the "to size" option for the scale command:

scale: Scale an image
	scale reference  -- the object for the command
 		[by factor real] -- scale using a scalefactor
 		[to size integer] -- scale using a max width/length

But what does that integer represent? Height, width, both, the longer dimension, the shorter dimension, or something else?

It's the longer dimension, in pixels, Michelle. So a routine that scales an image to a height of 135 pixels might use the command like this:


--------
set f to choose file of type {"public.image"} without invisibles
tell application "Finder" to set {name:n, name extension:e, folder:l} to f
tell (count e) to if it > 0 then set {n, e} to {n's text 1 thru -(it + 2), "." & e}
set p to POSIX path of (choose file name default name n & " [scaled]" & e default location l as alias)
tell application "Image Events"
close images
tell (open f)
set {w, h} to dimensions
if w > h then
scale to size w * 135 / h as integer
else
scale to size 135
end if
save in p
close
end tell
end tell
--------


---
kai


_______________________________________________ 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
  • Follow-Ups:
    • Re: Resizing image in image events
      • From: Emmanuel <email@hidden>
References: 
 >Resizing image in image events (From: Steve Suranie <email@hidden>)
 >Re: Resizing image in image events (From: Peter Waibel <email@hidden>)
 >Re: Resizing image in image events (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Scripting TextEdit, round II
  • Next by Date: Re: Mysterious Preferences File Again
  • Previous by thread: Re: Resizing image in image events
  • Next by thread: Re: Resizing image in image events
  • Index(es):
    • Date
    • Thread