Skip to main content
Participant
March 7, 2024
Question

running the extendscript adobe after effects script from the command line with the -nogui parameter

  • March 7, 2024
  • 0 replies
  • 165 views
if you put the jsч code below in the file "C:\\file_name.jsx" and run this script from the command line with different parameters, then the project file will not be created in -navi mode. The fault is in the call myLayer.applyPreset(myFilePressetEffect);. Error bypass try/catch It won't work.
 
var myItemCollection = app.project.items;
var myComp = myItemCollection.addComp("Comp_1", 1920, 1080, 1, 6, 25);
item = app.project.importFile(new ImportOptions(new File(encodeURI("~/Desktop/photo.jpeg")))); // impotr image
var myLayer = myComp.layers.add(item);
var myFilePressetEffect = new File(encodeURI("~/Desktop/Swaying_turning.ffx"));
try {
    myLayer.applyPreset(myFilePressetEffect);
} catch (e) {  
}
app.project.save(new File(encodeURI("~/Desktop/Comp.aep")));
app.project.close(CloseOptions.SAVE_CHANGES);
 
"C:\\Program Files\\Adobe\\Adobe After Effects 2024\\Support Files\\AfterFX.exe" -m -s  "var myArg=""; $.evalFile("C:\\file_name.jsx")" 
Ok. creates a file "C:/Comp_1.aep"
 
 starting from the command line with the parameter -noui 
"C:\\Program Files\\Adobe\\Adobe After Effects 2024\\Support Files\\AfterFX.exe" -noui -m -s  "var myArg=""; $.evalFile("C:\\file_name.jsx")" 
not create a file "C:/Comp_1.aep"
 
Is there any treatment?
In the attachment there is a Preset file for the project "Swaying_turning.txt" change the extension .ffx
This topic has been closed for replies.