-
Referencing a file through 2 layers of Scripts in After Effects
Hi Guys,
I am having an issue referencing a file through 2 AE scripts. Here is what I mean:
Script1 (The actual Script that you run):
scriptFile = new File(“C:/Scripts/Script2.jsx”);
$.evalFile(scriptFile);Script2:
//Create Null//
var myNull = curItem.layers.addNull(curItem.duration);
myNull.name = “Scale_Null”;
//Change Null Scale to an Expression//
var ActionFile = File(“Scale.js”);
var ActionFileText = ActionFile.open(“r”);
var ActionFileTextRead = ActionFile.read();
curItem.layer(“Scale_Null”).scale.expression = ActionFileTextRead;Scale.js:
A = thisComp.width;
[A, A];
_____________________________What I want:
1. Script1 is supposed Launch Script2
2. Script2 is supposed to create a Null and then reference a .js file which will be used as the expression for the Null’s scale.Problem:
1. Script1 Launches Script 2 fine.
2. Script2 creates the null.
3. Script2 refuses to reference the .js file
4. BUT When I launch Script2 directly (bypassing script1), The .js file is referenced and then used as the Null’s Expression.Please Help