Copy link to clipboard
Copied
So I have two scripts. One that opens the other.
So I open this script.
var w = new Window("palette","script",undefined);
var btn = w.add("button",undefined,"Lauch");
var file = new File("<u+200e>~/Desktop/test.jsx");
btn.onClick = function(){
if(!file.exists){
alert("WRONG LOCATIONS")
}
file.open("r");
eval(file.read());
file.close();
}
w.show();
Nothing special. Then I click the button and it opens the below script.ton",un
var w = new Window("dialog","script",undefined);
var btn = w.add("button",undefined,"TEST");
w.show();e = new
Now if I use "dialog", works fine. If I change it to palette. Not fine...Anyone know why this is? And how I can use "palette".
Cannot really explain why, but this works:
var w = new Window("palette", "script", undefined);
var btn = w.add("button", undefined, "TEST");
w.onResizing = function() {
this.layout.resize();
};
w.show();
Copy link to clipboard
Copied
Palettes have no hierarchy and exist all at the same level. I've seen it work somewhere, but likely it means writing a lot of code to have some global script running permanently managing both palettes, not like this. I'm sure some of the script gurus can explain it better.
Mylenium
Copy link to clipboard
Copied
Cannot really explain why, but this works:
var w = new Window("palette", "script", undefined);
var btn = w.add("button", undefined, "TEST");
w.onResizing = function() {
this.layout.resize();
};
w.show();
Find more inspiration, events, and resources on the new Adobe Community
Explore Now