🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #17389

Scale image

#17389
From: aran32
Date: Mon, 16 Jun 2003 18:29
35 lines
1786 bytes
Hi,

I�ve got this script to scale image, but i want transform the image and the box, both.

tell application "InDesign 2.0"
	tell document 1
		set theSelection to selection

		repeat with anItem in theSelection
			set theTarget to anItem
			set theClass to class of theTarget
			if theClass is in {EPS, PDF} then -- if the image is selected by direct tools
				set theTarget to parent of anItem
			end if

			if page item 1 of theTarget exists then
				tell theTarget
					fit given content to frame
					set horScale to (horizontal scale of page item 1) - 50.0 -- add 0.5 %
					set vertScale to (vertical scale of page item 1) - 50.0 -- add 0.5 %
					if horScale is greater than vertScale then
						set vertical scale of page item 1 to horScale
						set horizontal scale of page item 1 to horScale
					else
						set horizontal scale of page item 1 to vertScale
						set vertical scale of page item 1 to vertScale
					end if
					fit given center content
				end tell
			end if
		end repeat
	end tell
end tell

thanks
Technical Details
Message-ID: <1de98e7d.-1@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!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!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f939a,caaa090af548b23f,start
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-06-16 11:40:02 PST
From: aran32 <aran32@hotmail.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!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!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Scale image
Message-ID: <1de98e7d.-1@WebX.la2eafNXanI>
Date: Mon, 16 Jun 2003 11:29:39 -0700
Lines: 39
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit