MACSCRPT Archives

December 2009

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Workman <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Wed, 16 Dec 2009 13:13:56 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (33 lines)
Thanks for the reply. I tested the Image Events method and it works. One
issue though. The Identify command will get the size of eps files and other
files that Image Events will not. I would rather use identify (if I could
get it to work reliably).
mw

On Wed, 16 Dec 2009 12:42:30 -0500, Mark Lively <[log in to unmask]> wrote:
>This might not be the answer you are looking for but you can use image envents
>tell application "Image Events"
>	set animage to open (POSIX file "/Users/lively/Desktop/Screen shot
2009-12-16 at 12.38.25 PM.png" as alias)
>	get dimensions of animage
>	close animage
>end tell
>		--> {96, 126}
>
>or from the shell sips
>sips -g pixelHeight -g pixelWidth /Users/lively/Desktop/Screen\ shot\
2009-12-16\ at\ 12.38.25\ PM.png 
>/Users/lively/Desktop/Screen shot 2009-12-16 at 12.38.25 PM.png
>  pixelHeight: 126
>  pixelWidth: 96
>

>On Dec 16, 2009, at 12:28 PM, Mark Workman wrote:
>> I am using ImageMagick's Identify command (from shell script in an
>> applescript) to get some info about an image. I can display the info,
>> but I'd like to extract the height and width. I was able to get this to
>> work by pulling out all the characters between the 2nd and 3rd spaces.
>> This falls apart if the path has a space in it though. Anyone know a
>> good way to get this info.
>> Thanks.

ATOM RSS1 RSS2