I tried your script,
Move your defaults block before your onChange function and that will fix it.
Also, you should wrap your entire Script inside a function block to keep your variables local to your script, and not global.
Ben
Search found 7 matches
- May 29th, 2018, 7:23 am
- Forum: Scripts Discussion
- Topic: onChange event executing twice
- Replies: 3
- Views: 17599
- April 25th, 2018, 2:33 am
- Forum: Scripts Discussion
- Topic: Remove All Expressions from Selected Layers
- Replies: 2
- Views: 16504
Re: Remove All Expressions from Selected Layers
Hi, your loop is wrong. Selected Layers being an Array starting at index 0, your loop should be ( i < layerNumber NOT <= ) like so: if (layerNumber >= 1){ for (var i = 0; i < layerNumber; i++) { var layerNames = chosenLayers[i].index; recurse_children(comp.layers[l...
- March 18th, 2018, 9:21 pm
- Forum: Scripts Discussion
- Topic: How to target a layer other than the one currently selected
- Replies: 2
- Views: 14541
Re: How to target a layer other than the one currently selected
you can loop through the layers to find the one named "Hand". this will return a layer with a specific name, assuming you only have one layer with Hand in the name this is case sensitive. var handLayer = findLayer(app.project.activeItem,"hand") function findLayer(curComp,name){ ...
- March 16th, 2018, 10:19 am
- Forum: Script requests
- Topic: How to add images or icons in ScriptUI
- Replies: 4
- Views: 29147
- March 16th, 2018, 8:32 am
- Forum: Script requests
- Topic: How to add images or icons in ScriptUI
- Replies: 4
- Views: 29147
Re: How to add images or icons in ScriptUI
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 ); // a w.add ( "iconbutton" , undefined, f, { style : "toolbut...
- June 12th, 2017, 8:52 am
- Forum: Scripts Discussion
- Topic: Solid scale to size
- Replies: 2
- Views: 13899
Re: Solid scale to size
Hi Mike, You'll have to create new solid for each layer selected. Solid can only be created from a comp layer collection. Because you don't want to screw up your actual comp and loop by creating new layers in it and therefore changing the indexes and layer numbers, you can create a new comp, add a n...
- March 8th, 2017, 5:12 pm
- Forum: General Scripts Library
- Topic: Create sort of Metadata in AE project
- Replies: 8
- Views: 125840
Re: Create sort of Metadata in AE project
Hi,
Sometimes, I use the comment to store values that I need to retrieve, or to tag layers. It exists inside the project panel for any item. Or on layers in a comp.
app.project.item(index).comment , it's a string so you could store stringified JSON I guess (never tried it);
Ben
Sometimes, I use the comment to store values that I need to retrieve, or to tag layers. It exists inside the project panel for any item. Or on layers in a comp.
app.project.item(index).comment , it's a string so you could store stringified JSON I guess (never tried it);
Ben