🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #19319

Why can't I turn this into an integer?

#19319
From: Richard Ronnback
Date: Sun, 22 Dec 2002 08:46
23 lines
1761 bytes
Ok, so I thought I understood the use of integers, but apparently I was wrong... The following script is an attempt to check the effective resolution of a selected image. It kinda works, but I would like to present the result as an integer, rather then with a bazzillion decimals. Can anyone explain why I can't turn myEffectiveResolution into an integer?



 
tell application "InDesign 2.0.1" 
	if class of selection is not image then 
		display dialog "This script attempts to check the effective resolution of JPG and TIFF files. To use it, select an image with the direct selection tool" 
	else

		set myFilePath to file path of item link of selection as string 
		set myMultiplier to 100 / (horizontal scale of selection)

		tell application "Image Capture Scripting" 
			set this_image to open alias myFilePath 
			set myResolution to resolution of this_image 
		end tell

		set myEffectiveResolution to (myResolution * myMultiplier) 
		display dialog "The effective resolution of the selected image is" & return & (myEffectiveResolution as integer)

	end if 
end tell
Technical Details
Message-ID: <1de71a31.-1@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.online.be!newsfeed01.sul.t-online.de!t-online.de!WebX

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,c4754ff07041e2ce,start
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2002-12-22 01:09:07 PST
From: "Richard Ronnback" <richard.ronnback@telia.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.online.be!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Why can't I turn this into an integer?
Message-ID: <1de71a31.-1@WebX.la2eafNXanI>
Date: Sun, 22 Dec 2002 00:46:57 -0800
Lines: 30
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit