-
AE scripting – passing UI value field to a solid size
Hello
I’m trying to make simple script to learn AE scripting language and I would like to know if someone could help me … I’m just trying to pass a value from a text field in my UI Panel to a solid after pushing a create button… what seems to be simple … is just a torture for me
I created the button and assigned the script to create the solid … this is ok (it’s the beginner tutorial on another website) then I created a text field and I want to be able to put a value before pushing my create solid button… to not complicate with two text fields, the solid generated I would be a square 😛
Is there a structure base, a template or something to help create this … I tried to examine a lot and a lot of different scripts and I didn’t ended in a solution
I will continue to try.. but if somebody have a simple and elegant solution… thanks a lot
Why is there so less tutorials and documentation for AE scripting ? Do we have to be a developper to script in AE ?
thanks a lot for your help
var sizeInit = Number(75);//setup size variable
///////
win.tailleVal = win.add('edittext', [100,120,150,140], sizeInit);
win.tailleVal.onChange = function () {onSizeChange();};
///////
function onSizeChange(){//when a user changes the size
var sizeval = Number(tailleVal.text);//take the size value
writeLn("solid size changed to: " + sizeval);
return sizeval;
}///////
newLayer = currentComp.layers.addSolid([0,1.0,0], newName, sizeVal, sizeVal, 1);
newLayer.name = newName;