Copy link to clipboard
Copied
So this code (substituting the name of the user's home directory for [User Name] works great, the MOGRT is exported:
app.project.items[1].exportAsMotionGraphicsTemplate(true, "/Users/[User Name]/Work/test")
But this code throws an error saying the directory at ~/Work/test doesn't exist:
app.project.items[1].exportAsMotionGraphicsTemplate(true, "~/Work/test")
The ExtendScript debugger confirms the folder at ~/Work/test does in fact exist and is seen by the Folder object. This is a bug, right, and not something I'm just not getting?
Okay, the real solution is getting the fsName of the folder and passing THAT into exportAsMotionGraphicsTemplate().
Copy link to clipboard
Copied
Well, I guess an unfortunate behavior.
The parameter is not a File, which then would work as you expect out of the box.
Instead it is just a string, and the code does not appear smart enough to resolve it before trying to see if it exists.
Here is what you could do:
Create a File object with your ~path, then pass that File object and ask for the full path into the the export call.
Douglas Waterfall
After Effects Engineering
Copy link to clipboard
Copied
Yeah, the only way I could figure out to do it was to do a getRelativeURI("\") on the target folder and pass that string in for the path.
Copy link to clipboard
Copied
Okay, the real solution is getting the fsName of the folder and passing THAT into exportAsMotionGraphicsTemplate().