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 Lively <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Wed, 16 Dec 2009 12:42:30 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (39 lines)
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.
> 
> 
> <file:///C:\Documents%20and%20Settings\workmam\Application%20Data\Micros
> oft\Signatures\MyOrderInfo.gif> 
> Mark Workman 
> www.kramergraphics.com <http://www.kramergraphics.com> 
> P 937-296-9600
> F 937-296-7496 
> 
> 

ATOM RSS1 RSS2