How to add images or icons in ScriptUI

What type of scripts do you need?

Moderator: byronnash

Post Reply
User avatar
reubenlara
Posts: 10
Joined: March 16th, 2018, 6:22 am

Hello, I’ve scoured and scoured and can’t seem to find a clear tutorial on how to add imagery or simple icons to buttons in ScriptUI (specifically, I’m coding for after effects). I got a great start following the livestream primer by VihnSon Nguyen on YouTube and successfully got my panel working. But the ScriptUI resources I’ve found online (like this one) don’t seem to follow the structure outlined in that video. Maybe I’m missing how to integrate the two methods? Are there any helpful resources I’m not able to discover? I’m close to abandoning ScriptUI and trying my hand at HTML5 panels, but it seems like overkill for what I’m trying to accomplish. Any direction is appreciated!
wysee
Posts: 7
Joined: November 21st, 2016, 9:24 am

Get this ScriptUI Guide for dummies


On page 17 : 

var w= new Window("dialog");
w.orientation= "row";
var f= File ("/d/test/icon.png")
w.add("iconbutton", undefined, f); // aw.add("iconbutton", undefined, f,{style: "toolbutton"}); // bvar t1= w.add("iconbutton", undefined, f,{style: "toolbutton", toggle: true}); var t2= w.add("iconbutton", undefined, f,{style: "toolbutton", toggle: true}); t2.value= true;
w.show(); 
User avatar
reubenlara
Posts: 10
Joined: March 16th, 2018, 6:22 am

Thank you!! That helped a ton. So I see now that there are two ways of adding an interaction, and i was following the pattern set by the "Resource String." Is there a reference guide that details how to formulate unique elements? For example, how do you express the IconButton as a resource string? 
wysee
Posts: 7
Joined: November 21st, 2016, 9:24 am

User avatar
reubenlara
Posts: 10
Joined: March 16th, 2018, 6:22 am

fantastic, thanks!
Post Reply