Article View: adobe.scripting.indesign
Article #18930Re: AS: Can't move to spread
From: Olav Kvern
Date: Mon, 03 Feb 2003 22:56
Date: Mon, 03 Feb 2003 22:56
65 lines
3092 bytes
3092 bytes
Jan--
Here's a slightly rewritten version that doesn't use IDs. Does this help?
tell application "InDesign 2.0.1"
--Ref to the document
set myDocument to active document
set myTextInfoLayerName to "Text Info"
--If the measurement units of the active document are not points, set the
--measurement units to points.
if horizontal measurement units of view preferences of myDocument is not millimeters or vertical measurement units of view preferences of myDocument is not millimeters then
set myOldViewPreferences to properties of view preferences of myDocument
set horizontal measurement units of view preferences of myDocument to millimeters
set vertical measurement units of view preferences of myDocument to millimeters
set myResetUnits to true
else
set myResetUnits to false
end if
tell myDocument
-- Checks the document for links
set IDLinks to links whose status is normal
repeat with myCounter from (count IDLinks) to 1 by -1
set thisLink to item myCounter of IDLinks
set LinkName to name of thisLink
set ThisImage to parent of thisLink
set thisFrame to parent of ThisImage
set myPage to parent of thisFrame
set ImgPos to geometric bounds of thisFrame
set myY1 to (item 1 of ImgPos)
set myX1 to (item 2 of ImgPos)
set myY2 to (item 3 of ImgPos)
set myX2 to (item 4 of ImgPos)
-- Sets the textbox size
set myX2a to (myX2 - 60)
set myY2a to (myY2 + 4)
tell myPage
--Creates a textbox under the lowerright corner of the imagebox
set ImgTxtFrame to make text frame
--Move the text frame slightly to clear up page ownership issues.
move ImgTxtFrame by {1, 1}
set geometric bounds of ImgTxtFrame to {myY2, myX2a, myY2a, myX2}
end tell
--Adds the links name to the textbox
try
set applied paragraph style of insertion point -1 of ImgTxtFrame to Info
on error
set Info to make paragraph style with properties {name:"Info"}
end try
set contents of insertion point -1 of ImgTxtFrame to (LinkName as string)
end repeat
--Resets the units
if myResetUnits is true then
tell view preferences of myDocument to set properties to myOldViewPreferences
end if
end tell
end tell
Thanks,
Ole
Technical Details
Message-ID:
<1de7ab82.3@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de7ab82.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,7ab2baaed378bb0f X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-02-03 15:08:11 PST From: "Olav Kvern" <okvern@adobe.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: AS: Can't move to spread Message-ID: <1de7ab82.3@WebX.la2eafNXanI> Date: Mon, 3 Feb 2003 14:56:13 -0800 References: <1de7ab82.-1@WebX.la2eafNXanI> Lines: 71 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit