Skip to main content
Participating Frequently
June 26, 2012
Question

Get name of a frame

  • June 26, 2012
  • 2 replies
  • 734 views

I'm trying to access a number of frames, each will be formatted with different style sheets, via AppleScript.

I'm currently trying to to it using tags. I've tagged frames on master pages and library items, and those items will be used for the purposes of this script.

Here's what I want to happen:

1.) Loop though all frames on the page

2.) Deternine the name of the frame (i.e. the name of the tag associated with the frame)

3.) Perform an action on that frame dependant on the name of the tag

Now ... here are the questions:

1.) Is this the best way to approach the issue, or is there a better way to name frames in InDesign CS5.5?

2.) How do I get the name of the XML tag associated with the frame?

This topic has been closed for replies.

2 replies

Legend
June 26, 2012

Frames have no tag, the story has.

app.selection[0]

Result: [object TextFrame]

app.selection[0].parentStory.associatedXMLElement.markupTag.name

Result: Story

Dirk

Participating Frequently
June 26, 2012

HA!  I guess that explains why I couldn't figure out how to get the tag of a frame!

Thanks, Dirk

Participating Frequently
June 26, 2012

Nevermind, all!

I just discovered that I can, in fact, name a frame which solves the whole problem ... however, out of curiosity, if anyone wants to provide some insight on accessing tag names, I'm sure it would come in handy in the future!