Skip to main content
Participant
May 2, 2013
Question

Bring items in front of another

  • May 2, 2013
  • 1 reply
  • 2335 views

The applescript dictionary for InDesign says:

"bring to frontv : Brings the object to the front of its layer or in front of a particular item."

But how do you write to bring the object in front of a particular item? The command only accept one parameter (the object that it brings to front).

This topic has been closed for replies.

1 reply

Jump_Over
Legend
May 2, 2013

Hi,

this parameter is exactly what you need

myObject.bringToFront(particularObject);

Jarek

Participant
May 3, 2013

Thanks Jarek,

you saved my day! Though I had to use the "do script"-command to make it work in Applescript:

tell application "Adobe InDesign CS5"

          set mySelectedPageItems to selection

          set myObject to item 1 of mySelectedPageItems

          set particularObject to item 4 of mySelectedPageItems

          do script "arguments[0].bringToFront(arguments[1])" language javascript with arguments {myObject, particularObject}

end tell


I wasted so many hours yesterday trying to work it out in AS, but failed. Maybe someone know the right syntax in AS?

Jump_Over
Legend
May 3, 2013

Hi,

I would try:

tell application "Adobe InDesign CS5"

          set mySelectedPageItems to selection

          set myObject to item 1 of mySelectedPageItems

          set particularObject to item 4 of mySelectedPageItems

        tell myObject

               bring to front of particularObject

          end tell

end tell

however can not test it

Jarek