• 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
Re: InDesign CS2: Test graphics for item layer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: InDesign CS2: Test graphics for item layer


  • Subject: Re: InDesign CS2: Test graphics for item layer
  • From: David Wolfe <email@hidden>
  • Date: Fri, 5 Sep 2008 18:27:26 -0400

I got past this challenge by adding "as page item"

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

			tell active document
				repeat with i from 1 to count of myGraphics
					if name of item layer of page item i is "Text" then
						set theWarning to duplicate page item i
						set item layer of theWarning to "On Text"
						delete image of theWarning
						set content type of theWarning to unassigned


My next challenge is figuring out how to delete the content of the duplicated graphic. You can't set the content type to unassigned unless it doesn't have any content, but I can't figure out how to delete the image within the frame.


Anyone?

Thanks,
David

On Sep 5, 2008, at 5:25 PM, Stockly, Ed wrote:

David>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."

repeat with i from 1 to count of myGraphics


The error your getting is due to the construct of your repeat loop.

In this loop:

repeat with i from 1 to count of myGraphics

The variable i has a value of 1 then 2 then 3 etc. each time the loop is
executed.


You literally asking for the layer of the integer 1, which trips the error.

"if name of item layer of graphic i is. . ."

Is closer to what you want, but in CS2, item layer is not a property of
graphic, so that probably won't work.


You may need to try something like this:

(totally untested)

repeat with thisGraphic in myGraphics
repeat with x from 1 to count of item layers
  if thisGraphic is in item layer x then
     set LayerName to name of item layer x
     exit repeat
  end if
end repeat

HTH,
ES

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


This email sent to email@hidden


_______________________________________________
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
  • Follow-Ups:
    • Re: InDesign CS2: Test graphics for item layer
      • From: "Stockly, Ed" <email@hidden>
    • Re: InDesign CS2: Test graphics for item layer
      • From: David Wolfe <email@hidden>
References: 
 >Re: InDesign CS2: Test graphics for item layer (From: "Stockly, Ed" <email@hidden>)

  • Prev by Date: Re: InDesign CS2: Test graphics for item layer
  • Next by Date: Re: InDesign CS2: Test graphics for item layer
  • Previous by thread: Re: InDesign CS2: Test graphics for item layer
  • Next by thread: Re: InDesign CS2: Test graphics for item layer
  • Index(es):
    • Date
    • Thread