AE project path: expression script
Copy link to clipboard
Copied
Is there any way to get AE project path from exprssion script?
Copy link to clipboard
Copied
I don't think so. You need a script for that.
Copy link to clipboard
Copied
Expressions cannot access project items, only scripts. As I already said in your other post you must not mix up those things. Look up the app.project.path() method in the scripting guide, should you realyl mean scripts.
Mylenium
Copy link to clipboard
Copied
Mylenium​
I wonder if it's possible to eval() a *.jsx within an expression? I think I have seen something like that once...
Copy link to clipboard
Copied
How to connect the script file to ae project ?
Copy link to clipboard
Copied
You don't *connect a script to a project*. You add the script to the script folder or scriptUI folder and then launch the script within AE. The UI of the script appears, if it has one, or it just executes and do whatever it should do.
I have never done this, but AE supports start-up scripts, which run automatically on every launch of AE. Maybe this gets you close to what you want.
What are you trying to achieve? Maybe there is an other way to do it?!
Cheers,
*Martin
Copy link to clipboard
Copied
Currently we are using this expression code to get some text information from comment.txt file:
var aa = $.evalFile("file://C:/node/templates/2/comment.txt");
...
The matter is that we need to pass the path of the comment.txt at runtime.
For that purpose we assume to use script, and from script declare a variable which can be used here as a path for comments.txt file. When we would like to access app.project we get an error that app is not visible in ae scope, but the app visible in toolkit
SO is there some way how we can organize to get this path "file://C:/node/templates/2/comment.txt" dynamicly ?
Copy link to clipboard
Copied
hmm... you can write a script, that goes along the project path to get to your text file. Each project will have it's own text file and after your mastered relative paths with javascript, you'll probably find your project specific text file.
But now you can't give this variable to an expression. But you can use your script to create an expression, which will have the path. As an alternative, you can pass this path as string into a textlayers property "sourceText", and read it out by an other layers expression. But this is just a longer way of my first suggestion.
I'm not sure, that you actual mean with "at runtime", because everything is happening at runtime in java-universe. You don't have to compile anything.
Cheers,
*Martin
Copy link to clipboard
Copied
Thank you very much for suggestion. We are running after effects from cmd as soon as get the date required to be rendered in AE so saying runtime I mean each time when we run AE for new rendering content
Copy link to clipboard
Copied
I already thought so myself.
You have to find out, if AE runs a startup script, when you call aerender.exe from cmd. Otherwise, you have to find a way to create ready-to-render project files.
I think I have an idea of what you want to do, so maybe one of those plugins might be helpful:
Templater Rig - aescripts + aeplugins - aescripts.com
CompsFromSpreadsheet 5 - aescripts + aeplugins - aescripts.com
Cheers,
*Martin
Copy link to clipboard
Copied
Hi. did you find the solution? I'm with the same problem using aerender
Copy link to clipboard
Copied
Hi narinet,
Sorry for this issue. Did you ever find a solution? Please let us know if our experts’ advice helped you or if you still need help.
Thanks,
Kevin
Copy link to clipboard
Copied
thisProject.fullPath

