Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Is it possible to change a photo image via .txt $.eval or any other form that doesn’t require a script

  • Is it possible to change a photo image via .txt $.eval or any other form that doesn’t require a script

    Posted by Scott Mcgee on June 29, 2017 at 3:11 pm

    …Edit….

    Damn it, finally found someone asking the exact same question.
    https://forums.creativecow.net/thread/227/33364

    Unless something has changed in the last year, I’m guessing the answer is still not possible.

    ….Edit…..

    Is this possible?

    I have an image in a folder.

    1 – John Smith.png

    I’ve imported this into my AE comp, and use an expression to pull the name from the layer so my Text layer pops up John Smith.

    This is where the realms of “Is it possible” comes in.

    If I replace the image in the folder with.

    1 – Aaron Taylor.png

    when I open after effects, I want 1 – John Smith.png to replace itself and the Text layer now to say Aaron Taylor.

    I know there are scripts where I can click a button and I can reference 1 -, to replace the image layer, but I can’t use a script. I need it to replace itself some other way, similar to using an $.evalFile(myPath) with a txt file. Even if I can use a .txt file so it can replace itself based of reference like that would be also a way I would want to try.

    I know if I label it 1 and replace it with another file called 1. That will work. but I need the name to appear in the text, without someone manually having to put it in. I can’t find anything that might suggest this without the aid of a script, which is a pain, because a script would require someone to physically launch the script, which again I need it to do it without Manually updating it.

    Scott Mcgee replied 8 years, 7 months ago 2 Members · 7 Replies
  • 7 Replies
  • Dan Ebberts

    June 29, 2017 at 3:58 pm

    I don’t believe it’s possible.

    Dan

  • Scott Mcgee

    June 29, 2017 at 5:53 pm

    I thought as much.

    Thank you

  • Scott Mcgee

    June 29, 2017 at 7:13 pm

    It’s not the way I like to do things, but…

    By replacing the image with another image of the same name, that replaces the image no problem. Then my text layer references a .txt document using $.eval that you type the name into.

    It’s not great, but everyday an image has to be selected, so as much as I would like them to just rename the file by using something like 1 – John Smith to grab a reference. Opening a text document and Inputing a name. Then it replaces the name, at least that works.

    So it’s not great and I read that you yourself didn’t like this method, but I can’t have them opening the .aep file. This is to sit on a machine, in a corner collecting dust whilst CMD prompt launches AE and exports my project with the new inputed data from a .txt file created from an API developer.

    The only time it needs to be touched, if something goes wrong, which my demo version is working smoothly. So I’m feeling very positive.

    Who says you can’t create your own weather generator from 0p hahaha

  • Dan Ebberts

    June 29, 2017 at 8:13 pm

    A command prompt can launch a script, so maybe that would help.

    Dan

  • Scott Mcgee

    June 30, 2017 at 5:33 am

    Woah, you just broke my mind.

    I didnt’ t know you could launch a script via command. I’m looking forward to trying that out.

    In that case how would you suggest this then.

    because the script doesn’t want to be updated manually for the filepath e.g John Smith – 1.png to Aaron Taylor – 1.png or 1 – John Smith.png to 1 – Aaron Taylor.png

    What would I be best off using. I’m so used to using different methods indexOf or Substr to get this, my brain is struggling to compute that this would even work.

    I can’t think of a good way to work this.

    /Users/username/Desktop/1 – ” “.png
    or
    /Users/username/Desktop/” ” – 1.png

    Because there will be only the one picture in the folder. I guess indexOf and just look for 1.png.

  • Dan Ebberts

    June 30, 2017 at 6:25 am

    You could drop a text file (with a fixed name known to the script) into a known folder (maybe the same folder as the replacement file). The text file would contain the name (or path) of the replacement file. You’d do this before sending the command. Once the script launches, it would read the text file and make the substitution. I’ve done it with XML and JSON files, but a simple text file should work as well.

    Dan

  • Scott Mcgee

    January 24, 2018 at 11:52 am

    Hey Dan,

    I’m messing around with what you suggested a while back running a .jsx in command prompt. I’ve managed to launch aftereffects and a script, but is there a way to launch a script to change something in an after effects project without opening the project?

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy