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

IconButton via Resource String

Advocate ,
Sep 21, 2012 Sep 21, 2012

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

TOPICS
Actions and scripting
901
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
Adobe
Mentor ,
Sep 21, 2012 Sep 21, 2012

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.

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
Advocate ,
Sep 21, 2012 Sep 21, 2012
LATEST

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

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