• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
InDesign CS2: Test graphics for item layer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

InDesign CS2: Test graphics for item layer


  • Subject: InDesign CS2: Test graphics for item layer
  • From: David Wolfe <email@hidden>
  • Date: Fri, 5 Sep 2008 15:49:30 -0400

Hi everyone,

Can anyone tell me how to test for an item's layer? Using the documentation from CS2 and from the samples from Applescript Pro Sessions, I've put together the code below. When the script reaches "if name of item layer of i is. . ." it errors, stating, "Can't get item layer of 1."

I have tried many different methods, but all result in "unable to get item layer." I'm pretty sure the rest of the script works, but it's useless if I can't get all the graphics and filter them by what layer they're on.

Any ideas?

Thanks,
David Wolfe

tell application "Adobe InDesign CS2"
activate


if (count documents) > 0 then


--Set color to be used for problem highlighting
tell active document
if exists swatch "text layer" then
set theColor to "text layer"
else
set theColor to make new color with properties {model:spot, space:CMYK, color value:{0.0, 100.0, 100.0, 0.0}, name:"text layer", label:""}
end if
end tell


--set working layer
if exists layer "On Text" then
set active layer of active window to layer "On Text" of active document
else
tell active document
set newLayer to make new layer
set name of newLayer to "On Text"
end tell
set active layer of active window to layer "On Text" of active document
end if


set myGraphics to all graphics of active document
if (count myGraphics) > 0 then


tell active document
repeat with i from 1 to count of myGraphics
if name of item layer of i is "Text" then
set thisItem to duplicate graphic i
set item layer of thisItem to "On Text"
set content type of thisItem to unassigned
set fill color of thisItem to theColor
set blend mode of thisItem to multiply
end if
end repeat
end tell



else
display dialog "Please open a document containing graphics and try again." buttons "OK"
end if
else
display dialog "Please open a document and try again." buttons "OK"
end if


end tell
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: RE: Short form-solved
  • Next by Date: Re: Folder Actions Question
  • Previous by thread: Re: Folder Actions Question
  • Next by thread: Re: InDesign CS2: Test graphics for item layer
  • Index(es):
    • Date
    • Thread