Skip to main content
Participant
July 23, 2009
Question

[ CS3 / AS ] gather info about selection in layers panel?

  • July 23, 2009
  • 1 reply
  • 496 views

is it possible? I'd like the user to be able to select a range of layers that consist of alts for the active spread. when they run the script, the layers will be sequentially made visible and printed. when complete, the doc will be returned to the original state.

I'm perfectly comfortable doing all but gathering the selection info from the panel. for now, I can just present a 'choose list' of all layers but, it's a little less intuitive.

This topic has been closed for replies.

1 reply

Jongware
Community Expert
Community Expert
July 23, 2009

Unfortunately, the selection in any panel is not exposed to scripting.

Perhaps you can make your script display a list of checkboxes, one for each layer. That'd be somewhat better than a drop list.

Participant
July 23, 2009
Perhaps you can make your script display a list of checkboxes, one for each layer.

I was just going to use an AS dialog since I'm very foggy on the InD flavor. but checkboxes would be awfully nice. would you mind providing a sample of how the dialog would look? and how I would assign the results to a variable?

Participant
July 23, 2009

looks like I've answered my own question, with a little experimentation. if anyone has suggestions for the code below, I'd be glad to hear them.

tell application "Adobe InDesign CS3"
    set currentPage to object reference of active page of layout window 1
    set thisPage to name of currentPage
    set layerList to name of every layer of document 1
    set layerDialog to make dialog with properties {name:"select the page " & thisPage & " alt layers you'd like to print."}
    tell layerDialog
        tell (make dialog column)
            make static text with properties {static label:"layers:"}
        end tell
        set myLayersBoxes to (make dialog column)
        tell myLayersBoxes
            repeat with l in layerList
                make checkbox control with properties {static label:l, checked state:false}
            end repeat
        end tell
    end tell
    set layerDialogResult to show layerDialog
    if layerDialogResult = true then
        set altLayers to static label of (every checkbox control of myLayersBoxes whose checked state is true)
    end if
    destroy layerDialog
end tell