• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

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

Enthusiast ,
Dec 11, 2023 Dec 11, 2023

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?

TOPICS
Scripting

Views

151

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Dec 12, 2023 Dec 12, 2023

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

Votes

Translate

Translate
Adobe Employee ,
Dec 11, 2023 Dec 11, 2023

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 11, 2023 Dec 11, 2023

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 12, 2023 Dec 12, 2023

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines