Search found 7 matches

by wysee
May 29th, 2018, 7:23 am
Forum: Scripts Discussion
Topic: onChange event executing twice
Replies: 3
Views: 684

Re: onChange event executing twice

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
by wysee
April 25th, 2018, 2:33 am
Forum: Scripts Discussion
Topic: Remove All Expressions from Selected Layers
Replies: 2
Views: 390

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...
by wysee
March 18th, 2018, 9:21 pm
Forum: Scripts Discussion
Topic: How to target a layer other than the one currently selected
Replies: 2
Views: 411

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){  for(i=1; i<=curComp....
by wysee
March 16th, 2018, 8:32 am
Forum: Script requests
Topic: How to add images or icons in ScriptUI
Replies: 4
Views: 499

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 : "toolbutton" }); // b var t1 = w.add ( "iconbutton" , undefined...
by wysee
June 12th, 2017, 8:52 am
Forum: Scripts Discussion
Topic: Solid scale to size
Replies: 2
Views: 1212

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...
by wysee
March 8th, 2017, 5:12 pm
Forum: General Scripts Library
Topic: Create sort of Metadata in AE project
Replies: 8
Views: 1864

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