Article View: adobe.scripting.indesign
Article #17297Re: Reset transforms to 100%
From: Shane Stanley
Date: Mon, 16 Jun 2003 22:24
Date: Mon, 16 Jun 2003 22:24
41 lines
2615 bytes
2615 bytes
OK, I actually tested it this time. I think the 30470 comes from trying to transform group contents when it's already been done. And I've changed the text frame bit; what I swear was once working no longer is.
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
Shane
Technical Details
Message-ID:
<1de9579c.30@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!cyclone.bc.net!logbridge.uoregon.edu!xmission!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<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-06-16 15:38:07 PST From: "Shane Stanley" <sstanley@myriad-com.com.au> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!cyclone.bc.net!logbridge.uoregon.edu!xmission!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.30@WebX.la2eafNXanI> Date: Mon, 16 Jun 2003 15:24:31 -0700 References: <1de9579c.-1@WebX.la2eafNXanI> Lines: 46 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit