Skip to content

Instantly share code, notes, and snippets.

@GoodBoyNinja
Created February 1, 2021 13:42
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GoodBoyNinja/3a5bd64d670dc62b3e5f4e5662c607e7 to your computer and use it in GitHub Desktop.
Save GoodBoyNinja/3a5bd64d670dc62b3e5f4e5662c607e7 to your computer and use it in GitHub Desktop.
Copy and paste this template and write any code related to your UI inside the "buildUI" function. You can use 'ScriptUI Dialog Builder' - https://scriptui.joonas.me/ and then export the code and paste it inside the "buildUI" function. Note: Your script becomes dockable only when you place it in the "scriptUI Panels" folder. Reboot After-Effects …
(function(thisObj) {
// Any code you write here will execute before the panel is built.
buildUI(thisObj); // Calling the function to build the panel
function buildUI(thisObj) {
var windowName = "your script name";
var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("window", windowName, undefined, {
resizeable: true
});
// Write any UI code here. Note: myPanel is your window panel object. If you add groups, buttons, or other UI objects make sure you use myPanel as their parent object, especially if you are using the only ScriptUI panel builder.
myPanel.onResizing = myPanel.onResize = function() {
this.layout.resize();
};
if (myPanel instanceof Window) {
myPanel.center();
myPanel.show();
} else {
myPanel.layout.layout(true);
myPanel.layout.resize();
}
}
// Write your helper functions here
})(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment