Article View: adobe.scripting.indesign
Article #15743Re: ID2 script not working in ID3 (aka ID CS)
From: Shane_Stanley
Date: Wed, 19 Nov 2003 22:06
Date: Wed, 19 Nov 2003 22:06
51 lines
2483 bytes
2483 bytes
The main thing that's breaking your script is that PDFs, images, EPSes,
etc, are no longer page items -- instead, they belong to a new
superclass called graphic. While we're making that change, we can
rework things a bit to make the script a bit faster. Here's a different
approach to the main part of your script:
tell application "InDesign CS"
-- deal with containers first
-- get a lits of all selected rectangles, polygons and ovals that
contain a graphic
set theContainers to items of selection whose class is in {rectangle,
polygon, oval} and class of graphic 1 of it is in {EPS, PDF, image,
PICT, WMF}
repeat with myItem in theContainers
try
if myFilePath is true then
set myLinkName to file path of item link of graphic 1 of myItem as
Unicode text
else
set myLinkName to name of item link of graphic 1 of myItem as
Unicode text
end if
on error
set myLinkName to "File is embedded."
end try
my myMakeLabel(myItem, myLinkName, myFrameHeight)
end repeat
-- now deal with any directly selected graphics
set theGraphics to items of selection whose class is in {EPS, PDF,
image, PICT, WMF}
repeat with myItem in theGraphics
try
if myFilePath is true then
set myLinkName to file path of item link of myItem as Unicode text
else
set myLinkName to name of item link of myItem as Unicode text
end if
on error
set myLinkName to "File is embedded."
end try
my myMakeLabel(parent of myItem, myLinkName, myFrameHeight)
end repeat
end tell
If you actually want to run it on a spread or a whole document, you
could just use the second part of the above and change "selection" to
"all items of <spread x/document x>".
--
Shane Stanley <sstanley@myriad-com.com.au>
Technical Details
Message-ID:
<92A824A8-1ADC-11D8-90CA-003065D61B90@myriad-com.com.au>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webxReferences:
<2cce77d0.-1@webx.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,e16117a3867bc5dc X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-11-19 14:08:15 PST From: Shane_Stanley@adobeforums.com Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: Re: ID2 script not working in ID3 (aka ID CS) Message-ID: <92A824A8-1ADC-11D8-90CA-003065D61B90@myriad-com.com.au> Date: Wed, 19 Nov 2003 14:06:06 -0800 References: <2cce77d0.-1@webx.la2eafNXanI> Lines: 54 X-Mailer: Apple Mail (2.606) MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit