Copy link to clipboard
Copied
Hi,
say that I have:
var str = "dialog { \
btn1: Button { text: 'clickMe 1' },\
btn2: Button { text: 'clickMe 2' }\
}"
var w = new Window(str)
w.show();
which gives a dummy ScriptUI Window of type 'dialog'.
I'd like to comment out a part of that resource String, say the btn1 line. How do I do?
Inline... I'd say it's not possible, so I've tried
// they don't work 😕
w.btn1 = null; // or undefined
delete w.btn1;
To no avail. I cannot use
w.btn1.visible = false;
because the element, still, will occupy his own Window real estate even if it's invisible:
While what I'm after is a way to comment out the element so that the result is:
Basically I've quite complex resource strings that I don't want to mess up when I experiment. I could duplicate the entire code, but I'm curious to see whether there are smarter options.
Suggestions are really appreciated 🙂
Thank you!
Davide Barranca
---
Photoshop HTML Panels Development course
hyyp://htmlpanelsbook.com
Ciao Davide,
This seems to work for me in Photoshop CS4 Mac OS X:
var str = "dialog { btn1: Button { text: 'clickMe 1' }, btn2: Button { text: 'clickMe 2' } }"
var w = new Window (str)
w.remove (w.btn1)
w.show ();
or:
var str = "dialog { btn1: Button { text: 'clickMe 1' }, btn2: Button { text: 'clickMe 2' } }"
var w = new Window (str)
w.remove ("btn1")
w.show ();
or:
var str = "dialog { btn1: Button { text: 'clickMe 1' }, btn2: Button { text: 'clickMe 2' } }"
var w = new Window (str)
w.remove (0)
w.show ();
Fro
...Copy link to clipboard
Copied
Ciao Davide,
This seems to work for me in Photoshop CS4 Mac OS X:
var str = "dialog { btn1: Button { text: 'clickMe 1' }, btn2: Button { text: 'clickMe 2' } }"
var w = new Window (str)
w.remove (w.btn1)
w.show ();
or:
var str = "dialog { btn1: Button { text: 'clickMe 1' }, btn2: Button { text: 'clickMe 2' } }"
var w = new Window (str)
w.remove ("btn1")
w.show ();
or:
var str = "dialog { btn1: Button { text: 'clickMe 1' }, btn2: Button { text: 'clickMe 2' } }"
var w = new Window (str)
w.remove (0)
w.show ();
From https://www.adobe.com/content/dam/Adobe/en/devnet/scripting/pdfs/javascript_tools_guide.pd f :
HTH,
--Michel
Copy link to clipboard
Copied
Gee, it was in the documentation; what a silly old boy I've become 🙂
Thank you very much Michel!
Davide
Find more inspiration, events, and resources on the new Adobe Community
Explore Now