Copy link to clipboard
Copied
When After Effects launches, the default file is "Untitled Project.aep" - is this a file being loaded, or is it being created on load? I would like to modify the default file that is loaded programmatically, I saw there is an option for using templates but it was not clear how to set that template via scripting.
Can I simply replace the "Untitled Project.aep" file somewhere, or is it more complicated than that?
Okay I found the answer, so for anyone looking for this who needs to know:
within your engine_init.py file in SGTK, you can add this snippet and it will run the ExtendScript to set the template with the desired settings:
template_path = "/your/path/to/template.aet"
engine.adobe.rpc_eval("app.preferences.savePrefAsString('Template Project', 'Enabled', 01, PREFType.PREF_Type_MACHINE_INDEPENDENT); app.preferences.savePrefAsString('Template Project', 'Location', '{}', PREFType.PREF_Type_MACHINE_INDEP
...
Copy link to clipboard
Copied
You can setup a "New project loads Template" in the Preferences.
See https://aereference.com/tips/set-a-default-folder-structure-for-new-projects
Copy link to clipboard
Copied
Is there a way to set this pythonically via Shotgrid Toolkit?
Copy link to clipboard
Copied
Okay I found the answer, so for anyone looking for this who needs to know:
within your engine_init.py file in SGTK, you can add this snippet and it will run the ExtendScript to set the template with the desired settings:
template_path = "/your/path/to/template.aet"
engine.adobe.rpc_eval("app.preferences.savePrefAsString('Template Project', 'Enabled', 01, PREFType.PREF_Type_MACHINE_INDEPENDENT); app.preferences.savePrefAsString('Template Project', 'Location', '{}', PREFType.PREF_Type_MACHINE_INDEPENDENT); app.preferences.reload();".format(template_path))
Copy link to clipboard
Copied
An empty project is always untitled until you save it. Auto Save will not start until you save a project. I occasionally create Template projects, but most of the time, my workflow is File/New Project > Save, then I start adding assets and creating comps. I don't remember the last time I used a script to open a project, but you could certainly create a script that looks for an AET file in a specific folder and opens that. You will still need to give it a Name and save it for Auto Save to start working.