Article View: adobe.scripting.indesign
Article #2341Re: Retrieving index of a selected Rectangle/Image
From: Justin_Monsees
Date: Mon, 29 Dec 2008 04:23
Date: Mon, 29 Dec 2008 04:23
13 lines
1597 bytes
1597 bytes
Dave,
you're right. I'm trying to accomplish this using Javascript. Essentially I'm trying to modify the "LabelGraphics.jsx" file that I was able to download as a sample script. This script adds a text box underneath all of graphics. I just want it to add a text box to the one that is currently selected. Here's the piece of code that I'm trying to modify. Let me know if you need more information.
function myAddLabels(myLabelType, myLabelHeight, myLabelOffset, myLabelStyleName){
var myDocument = app.documents.item(0);
var myGraphics = myDocument.allGraphics;
myLabelStyle = myDocument.paragraphStyles.item(myLabelStyleName);
for(var myCounter = 0; myCounter < myGraphics.length; myCounter++){ myAddLabel(myDocument, myGraphics[myCounter], myLabelType, myLabelHeight, myLabelOffset, myLabelStyle); } }
Instead of using a "for" loop I only want to reference the currently selected rectangle.
Justin M.
Technical Details
Message-ID:
<59b7604e.1@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!webcrossingReferences:
<59b7604e.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,be5a41652ed26385 X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Justin_Monsees@adobeforums.com Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: Retrieving index of a selected Rectangle/Image Message-ID: <59b7604e.1@webcrossing.la2eafNXanI> Date: Sun, 28 Dec 2008 20:23:39 -0800 References: <59b7604e.-1@webcrossing.la2eafNXanI> Lines: 12 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Original-Lines: 24