Article View: adobe.scripting.indesign
Article #19324Re: Why can't I turn this into an integer?
From: Richard Ronnback
Date: Mon, 23 Dec 2002 09:40
Date: Mon, 23 Dec 2002 09:40
40 lines
2233 bytes
2233 bytes
Here is the script pretty much the way I want it. tell application "InDesign 2.0.1" set myErrorMsg to "This script attempts to check the effective resolution of PSD, JPG and TIFF files. To use it, select an image with the direct selection tool" try if class of selection is not image then display dialog myErrorMsg else set myFilePath to file path of item link of selection as string set myHorMultiplier to 100 / (horizontal scale of selection) set myVerMultiplier to 100 / (vertical scale of selection) tell application "Image Capture Scripting" set this_image to open alias myFilePath set myResolution to resolution of this_image close this_image end tell set myHorRes to round (myResolution * myHorMultiplier) set myVerRes to round (myResolution * myVerMultiplier) if myHorRes is equal to myVerRes then display dialog "The effective resolution of the selected image is:" & return & myHorRes & space & "dpi" else display dialog "The selected image is not proportionally scaled. The effective resolution is:" & return & � return & � "Horizontal resolution:" & space & myHorRes & space & "dpi" & return & � "Vertical resolution:" & space & myVerRes & space & "dpi" & � return end if end if on error display dialog myErrorMsg end try 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!38.144.126.75.MISMATCH!feed1.newsreader.com!newsreader.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de71a31.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f939a,c4754ff07041e2ce X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2002-12-23 02:07:52 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!38.144.126.75.MISMATCH!feed1.newsreader.com!newsreader.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: Why can't I turn this into an integer? Message-ID: <1de71a31.1@WebX.la2eafNXanI> Date: Mon, 23 Dec 2002 01:40:48 -0800 References: <1de71a31.-1@WebX.la2eafNXanI> Lines: 44 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit