Skip to main content
Inspiring
Dec 11, 2023 11:18 PM UTC
Answered

CompItem.exportAsMotionGraphicsTemplate() claims paths beginning with ~ (tilde) don't exist

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?

This topic is closed to new replies. Start a new post to keep the conversation going.
Aaron CobbCorrect answer
Inspiring
Dec 12, 2023 10:42 PM UTC

Okay, the real solution is getting the fsName of the folder and passing THAT into exportAsMotionGraphicsTemplate(). 

3 replies

Aaron CobbAuthorCorrect answer
Inspiring
Dec 12, 2023 10:42 PM UTC

Okay, the real solution is getting the fsName of the folder and passing THAT into exportAsMotionGraphicsTemplate(). 

Translate
Inspiring
Dec 12, 2023 12:07 AM UTC

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.

Translate
Adobe Employee
Dec 11, 2023 11:33 PM UTC

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

Translate