Skip to main content
Inspiring
November 27, 2013
Question

Storing selection in palette

  • November 27, 2013
  • 0 replies
  • 429 views

Hi.

I'm trying to store my current selection in a palette listbox and then select the objects when the listbox item is clicked.

This is proving problematic since I can't access the specific  Illustrator objects from the palette.

I've managed to get the selection using something like this:

function BTactiveDocumentSelection()

{

    return app.activeDocument.selection;

}

     addButton.onClick = function()

     {

          var inSelection;

          var bt = new BridgeTalk();

          bt.target = "illustrator";

          bt.body = BTactiveDocumentSelection.toString()+'BTactiveDocumentSelection();';

          bt.onResult = function(result)

          {

               inSelection= result.body;

                       

               if (inSelection != 0)

               {

                    titlesList.add("item", inSelection);

                }

          }

          bt.send();

     }

But I'm not sure how to return it to select it later with another BridgeTalk since converting it to string doesn't seem to retain the reference to the original objects.

And I'm not sure it did in the first place when I got it.

Help would be appreciated.

This topic has been closed for replies.