This content has been marked as final.
Show 4 replies
-
1. Re: Referencing an object, based on it's characteristics (fill color)
[Jongware] Apr 20, 2012 5:58 AM (in response to PrntScr)No. To find an object based on its characteristics, you have to manually loop over each possible candidate and check one by one.
-
2. Re: Referencing an object, based on it's characteristics (fill color)
Kasyan Servetsky Apr 20, 2012 6:00 AM (in response to PrntScr)Here is an example:
Main(); function Main() { var doc = app.activeDocument; var rectangles = doc.rectangles; var swatch = doc.swatches.item("C=15 M=100 Y=100 K=0"); for (var i = rectangles.length-1; i >= 0; i--) { if (rectangles[i].fillColor == swatch) rectangles[i].remove(); } } -
3. Re: Referencing an object, based on it's characteristics (fill color)
PrntScr Apr 20, 2012 6:09 AM (in response to Kasyan Servetsky)Thanks a lot, that should help me get started.
-
4. Re: Referencing an object, based on it's characteristics (fill color)
Kasyan Servetsky Apr 20, 2012 6:18 AM (in response to PrntScr)By the way, in Apple Script you can reference an object based on it's characteristics like so:
tell application "Adobe InDesign CS5.5" set doc to active document tell doc set red_swatch to swatch "C=15 M=100 Y=100 K=0" tell (rectangles whose fill color is red_swatch) to delete end tell end tell
This is the same script as above.


