Copy link to clipboard
Copied
Hello,
while this way I'm able to define the icon for an IconButton:
var f = new File("~/desktop/res/ZoomIn.png")
var w = new Window('dialog', undefined, undefined)
w.add('iconbutton', undefined,f)
w.show()
I've not found a way to define the icon via Resource Strings - the following is my try but alas it doesn't work:
var f = new File("~/desktop/res/ZoomIn.png")
var winRes = "dialog { zoomInButton: IconButton { properties: { image:f } } }" // using icon:f doesn't work either
var w = new Window(winRes)
w.show();
Resource strings are nicer, but a bit less documented imho.
One option is to add the property later:
w.zoomInButton.image = f;
But I'd like to keep everything in the res string.
Thanks in advance
Davide
Copy link to clipboard
Copied
I don't use resource strings when creating dialogs but I would think the problem is how to get a file object into the resource string. In Dr Brown's 1-2-3 Process script there is a resource string that creates icons. But it uses resource images.
It could be that resource images are the only image types you can use in a resource string.
Copy link to clipboard
Copied
Hi Michael,
in fact resource images work to me too - it could be like you say (yet it would be a weird limitation anyway).
I've tried with File object, direct path, even ScriptUI.newImage() but with no luck.
Thanks
Davide
Find more inspiration, events, and resources on the new Adobe Community
Explore Now