Skip to main content
Known Participant
August 7, 2009
Answered

Getting script to detect selected frame (AS CS3)

  • August 7, 2009
  • 2 replies
  • 832 views

After years of scripting old Quark, I am making my first, faltering steps in InDesign. Starting with something simple, I am trying to get an applescript to detect a selected frame anywhere in a document. Following the examples, I have already conversed with a frame when I know which page it is on. What I am interested in is being able to get a script to work with no hard-wired references to "Page 1" etc. Hope I haven't overlooked something in the examples!

This topic has been closed for replies.
Correct answer sstanleyau

The rough equivalent of "current box" is "item 1 of selection", although often you can just address "selection" as if it's a reference to a single item, even though it always returns a list.

--

Shane Stanley <sstanley@myriad-com.com.au>

AppleScript Pro Sessions <http://scriptingmatters.com/aspro>

2 replies

sstanleyauCorrect answer
Inspiring
August 7, 2009

The rough equivalent of "current box" is "item 1 of selection", although often you can just address "selection" as if it's a reference to a single item, even though it always returns a list.

--

Shane Stanley <sstanley@myriad-com.com.au>

AppleScript Pro Sessions <http://scriptingmatters.com/aspro>

interesting_Flower157F
Inspiring
August 7, 2009

document.selection[0] is what you are looking for i think. (JS - how it translates to AS i dont know, but in the OMV, under document, there should be a selection)

Known Participant
August 7, 2009

Thanks, Thomas, your JS hint was enough to get me where I wanted.