🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #17196

Re: Reset transforms to 100%

#17196
From: Kenny Hoff
Date: Tue, 01 Jul 2003 19:17
36 lines
2517 bytes
Hmm,
Been a while since I checked in here. Thanks Shane for posting the version above. I tried it, though, and it still seems to revert the frame content to the original size. Maybe you could point out which attribute in the script below affects the frame content...

tell application "InDesign 2.0.2"
	set myFrame to item 1 of selection
	if class of myFrame is not in {group, table} then
		set theProps to properties of myFrame
		set thePercent to vertical scale of theProps
		if page item 1 of myFrame exists then
			try
				set myVScale to absolute vertical scale of myPic
				set myHScale to absolute horizontal scale of myPic
				set picBounds to geometric bounds of myPic
			end try
		end if
		--Beware line breaks: Following line should start with "set theProps" and ends with "& theProps"
		set theProps to {absolute vertical scale:nothing, vertical scale:100, absolute horizontal scale:nothing, horizontal scale:100, stroke weight:thePercent * (stroke weight of theProps) / 100, corner radius:thePercent * (corner radius of theProps) / 100} & theProps
		set properties of myFrame to theProps
		try
			--Beware line breaks: Following line should start with "set" and ends with "picBounds}"
			set properties of page item 1 of myFrame to {absolute vertical scale:thePercent * myVScale / 100, absolute horizontal scale:thePercent * myHScale / 100, geometric bounds:picBounds}
		end try
	else if class of myFrame is group then
		try -- next line will fail if group is already at 100%
			transform group contents myFrame
			set allItems to all page items of myFrame
			repeat with i from 1 to count of allItems
				if class of item i of allItems is text frame then
					scale text attributes item i of allItems
				end if
			end repeat
		end try
	end if
end tell

THANKS!
Technical Details
Message-ID: <1de9579c.33@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <1de9579c.-1@WebX.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,3645d1b4a9bc81d1
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-07-01 12:38:18 PST
From: "Kenny Hoff" <kenny@laneandlanedesign.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: Reset transforms to 100%
Message-ID: <1de9579c.33@WebX.la2eafNXanI>
Date: Tue, 1 Jul 2003 12:17:38 -0700
References: <1de9579c.-1@WebX.la2eafNXanI>
Lines: 46
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit