Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Is it possible to use AI "selection sets" in script and scriptUI?

Explorer ,
Sep 23, 2014 Sep 23, 2014

Wondering is there way to use those selection sets that found from Select menu in script?

SelectionSet.png

Using this list in ScriptUI where I can select them. This would help me to use selection while I'm in "dialog" type list. Anyone have solution?

SelectionSet_Browse.png

TOPICS
Scripting
1.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Sep 24, 2014 Sep 24, 2014

Yay! BridgeTalk isn't most easiest and best documented case, but there is good samples. Thanks guys for keeping me on the right track

After couple tries I got some message through BT And still with palette type window! Now this opens totally new possibilities

#target illustrator

#targetengine main

var script_name = "BridgeTalk Test"

var doc = app.activeDocument;

var doc_selection = doc.selection;

function btMsg() {

    var bt = new BridgeTalk;

    bt.target = "illustrator";

    var message

...
Translate
Adobe
Community Expert ,
Sep 23, 2014 Sep 23, 2014

not directly, but you could record actions that use each selection, then you could run either action with your script, if you have CS6 or newer.

another more direct option would be to give unique names to your objects, so your script can find them and select them (or not, you don't need to select an object to work on it, just need to get a reference to it)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 23, 2014 Sep 23, 2014

Thanks for the answer Carlos.

The reason why I would like to use those sets was to help me choose easily set of items. I have used "dialog" type window and then I cannot interact with AI UI. But I made some research and found some interesting topics. I guess there is workarounds for this type windows to get those work to use BridgeTalk if I'm right.

Like in this script example -> http://kasyan.ho.com.ua/save_psd_png_delete.html There is interaction but still can use PS UI.

Couple good articles was:

http://www.davidebarranca.com/2012/11/scriptui-bridgetalk-persistent-window-examples/

http://www.davidebarranca.com/2012/10/scriptui-window-in-photoshop-palette-vs-dialog/

I just want to use basic interaction with my document elements and still keep my script window opened. Like select all layers with text with just clicking the ScriptUI window button without get it to closed Maybe I'll continue to research more about BridgeTalk topic. Just say if I'm on wrong way in this case

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 23, 2014 Sep 23, 2014

You're on the right track, Bridge Talk is the way to go, David e's page is an excellent resource. You can also search this forum, we have posted lots samples on the topic

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Sep 23, 2014 Sep 23, 2014

What I experienced with BridgeTalk is summed up as learning how to write everything needed to be done inside of a function which can then be sent through bridgetalk as a string to be ran as a totally independent script, and having twice the fun because it didn't really throw any error and failed silently when working with palette.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 23, 2014 Sep 23, 2014

Debugging is part of the fun!! Bridge Talk is tricky at first, but it's easy now that there are working samples out there

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 24, 2014 Sep 24, 2014

Yay! BridgeTalk isn't most easiest and best documented case, but there is good samples. Thanks guys for keeping me on the right track

After couple tries I got some message through BT And still with palette type window! Now this opens totally new possibilities

#target illustrator

#targetengine main

var script_name = "BridgeTalk Test"

var doc = app.activeDocument;

var doc_selection = doc.selection;

function btMsg() {

    var bt = new BridgeTalk;

    bt.target = "illustrator";

    var message = objInfo + '\r objInfo(doc_selection);';

    bt.body = message;

    bt.send();

}

function objInfo() {

    var doc = app.activeDocument;

    var doc_selection = doc.selection;

  

    for ( i = 0; i < doc_selection.length; i++ ) {

        $.writeln ( + " Hello BridgeTalk!");

    }

}

startGUI();

function startGUI() {

  

    // Create Main Window

    var win = new Window( "palette", script_name);

  

    // Style Option for main Window

    win.orientation = "column";

    win.alignChildren = ["fill", "fill"];

  

    // PANEL: Objects Group

    var objGrp = win.add("panel", undefined, "Objects");

    objGrp.orientation = "row";

    objGrp.alignChildren = ["fill", "fill"];

      

    // BTN: Object Info

    var btnObjInfo = objGrp.add('button', undefined, "Selected Objects");

    btnObjInfo.onClick = function () {

        btMsg();

    };

    // Close button

    win.quitBtn = win.add("button", undefined, "Close");

  

    // Event listener for the quit button

    win.quitBtn.onClick = function() {

        win.close();

    }

    // Centering & Show Window

    win.center();

    win.show();

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 24, 2014 Sep 24, 2014

you're welcome, thanks for posting your script, it should help future generations.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 02, 2015 Jan 02, 2015
LATEST

wow this is some bizarre syntax - but is the key for BT messaging to work, apparently:

var message = objInfo + '\r objInfo(doc_selection);';

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines