Copy link to clipboard
Copied
Hello !
I am working on a randomizer script for illustrator, and i am stubling on a problem.
I would like my script to be a palette, but when i change
new Window("dialog", ...)
to
new Window("palette", ...)
my script can no longer call app.activeDocument .
Here are the bits of code interesting :
#target illustrator
#targetengine "session"
var dialogUI = (function () {
var palette = new Window("palette", undefined, undefined, {closeButton: true, resizeable: true});
[...]
var apply = group_button.add("button", undefined, undefined, {name: "apply"});
apply.text = "apply";
apply.addEventListener("click",function(){
MyDoc = app.activeDocument;
MySelection = MyDoc.selection;
if(MySelection instanceof Array){
if(tab_selectionnee == tab_fill_colour){
random_background_color()
}
}
app.redraw()
})
palette.show();
}());
The error is where MyDoc = app.activeDocument; is, and MySelection = ... is never called
Does anyone have an idea on how to solve this ?
it's a known issue, you must use BridgeTalk to have a Palette talk to Illustrator and vice versa.
check this thread for a sample
Copy link to clipboard
Copied
it's a known issue, you must use BridgeTalk to have a Palette talk to Illustrator and vice versa.
check this thread for a sample
Copy link to clipboard
Copied
Thanks a lot !
I saw a forum post from 2014 but i hoped Adobe would have solved this issue (is this an issue ?).
Anyway, it is working just fine even if it is a pain in the ass :D.
Have a great day sir.