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

After Effects: AE Expressions Relative text file path

New Here ,
Aug 23, 2017 Aug 23, 2017

Copy link to clipboard

Copied

I am using After Effects and would like to made the AE Expressions script to read in text from an external .txt-file with relative path ? I used the code below but keeping on getting the error path not found:

try{ myPath = "../Grafiche/ePriceData.txt"; $.evalFile(myPath); eval(thisComp.name)[index+1]; 

} catch(err){ err; }

Is there a way to use relative path in AE expressions for txt file ?

Views

1.7K

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
LEGEND ,
Aug 23, 2017 Aug 23, 2017

Copy link to clipboard

Copied

No. Paths can only be absolute.

Mylenium

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
New Here ,
Aug 23, 2017 Aug 23, 2017

Copy link to clipboard

Copied

Thanks, the app object is not visible in global scope.
But we can see it in Extend-> Script-> Toolkit. DO you have soem ideas ?

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
LEGEND ,
Aug 23, 2017 Aug 23, 2017

Copy link to clipboard

Copied

I'm not really clear what you are asking. Somehow you're throwing scripts and expressions into the same pot, which makes no sense. As far as evaluating a text file in an expression goes, it requires an absolute path. It only worked with a relative path once in CS5 or so if I remeber, which actualyl was a security leak/ bug in the script engine. it should not be possible. If you use scripts to apply your expressions, nothing stops you from constructing the path at runtime using string operations and applying them as a property. Otherwise this is a no-go and since that whole thing is more or less an unsupported hack, you should definitely think of using safe alternatives, anyway.

Mylenium

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
New Here ,
Aug 24, 2017 Aug 24, 2017

Copy link to clipboard

Copied

I really don't want to miss expressions with scripts but I didn't understand clearly is it possible to call function from the script in expression or not

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
Adobe Employee ,
Aug 31, 2017 Aug 31, 2017

Copy link to clipboard

Copied

Hi NarineT,

Sorry for this issue. Did you ever find a solution? Please let us know if you have or if you still need help.

Thanks,

Kevin

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
Explorer ,
Feb 08, 2018 Feb 08, 2018

Copy link to clipboard

Copied

I know this is a bit of an old thread, but I am attempting to do the same thing - pull in data from a txt file that exists in the same folder as the project file. As this will be a template that I re-use over and over with different data each time, based on MyIenium's response, I will need to construct the path at runtime using string operations. Can anyone point me towards a resource for how this would be accomplished? Thanks in advance!

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
LEGEND ,
Feb 09, 2018 Feb 09, 2018

Copy link to clipboard

Copied

LATEST

After Effects can now read and use JSON files. This is a fairly new feature. You might look into that.

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