Highlighted

Read text from external file and send to AME automation

Community Beginner ,
Aug 29, 2020

Copy link to clipboard

Copied

 
 

Hi everybody 

 

I'm new to javascript/extendscript. I like to ask about automation and i don't even know if its possible to do. 

 

Now i have text layer named "City" contains city name, and comp name starting like Everything about + textlayer.source. Beginning of comp name is fixed and when i change text source, it will be added to the comp name. Thanks to fellas in forum i figured out this with simple script like this :

 

 

var myComp = app.project.activeItem;
var nameLayer = myComp.layer("City");
var theText = nameLayer.property("Source Text").value.text;

 myComp.name = "Everything about" + theText;

 

 So this is my scripting level, maybe a little bit more. I m changing text to for example "Berlin", run script and comp name become "Everything about Berlin" then send it to AME Render Queue manually each time. 

 

Problem is that i have .txt file with more than 350 cities line by line. Question is obvious, is there a way to read text from .txt or .csv file, a line at a time, evaluate script, send it to AME and repeat process for each line in .txt file? 

 

Thank you.

TOPICS
Dynamic link, Import and export, Scripting

Views

89

Likes

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

Read text from external file and send to AME automation

Community Beginner ,
Aug 29, 2020

Copy link to clipboard

Copied

 
 

Hi everybody 

 

I'm new to javascript/extendscript. I like to ask about automation and i don't even know if its possible to do. 

 

Now i have text layer named "City" contains city name, and comp name starting like Everything about + textlayer.source. Beginning of comp name is fixed and when i change text source, it will be added to the comp name. Thanks to fellas in forum i figured out this with simple script like this :

 

 

var myComp = app.project.activeItem;
var nameLayer = myComp.layer("City");
var theText = nameLayer.property("Source Text").value.text;

 myComp.name = "Everything about" + theText;

 

 So this is my scripting level, maybe a little bit more. I m changing text to for example "Berlin", run script and comp name become "Everything about Berlin" then send it to AME Render Queue manually each time. 

 

Problem is that i have .txt file with more than 350 cities line by line. Question is obvious, is there a way to read text from .txt or .csv file, a line at a time, evaluate script, send it to AME and repeat process for each line in .txt file? 

 

Thank you.

TOPICS
Dynamic link, Import and export, Scripting

Views

90

Likes

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
Aug 29, 2020 0
Most Valuable Participant ,
Aug 29, 2020

Copy link to clipboard

Copied

Should be easily doable using the app.executeMenuCommand() and combing through your file in a loop. It will just be a bit more complicated than your simplistic three lines of code, obviously. The other question is whether anything actually will work without crashing. Creating 350 comps in a project will at the very least take some time and I'm not sure if AME would be able to handle that many render queueu entires as well.

 

Mylenium

Likes

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
Reply
Loading...
Aug 29, 2020 1
Community Beginner ,
Aug 29, 2020

Copy link to clipboard

Copied

Thank you for answer. I m aware it will be escalated quickly. And as far as i know AME only takes from AE Queue, no direct way. Instead of creating 350 comps, what about save incrementally as 350 aep? It is 4K project but there is almost nothing as far as layers and plug-ins. Everything pre-rendered. 5 jpeg sequences 1 camera, 1 light and 1 plug-in Element 3D with light settings. It is not doable for me since i dont remember how to use loop properly. Any tips to get workflow faster? 

Likes

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
Reply
Loading...
Aug 29, 2020 0
Community Beginner ,
Aug 29, 2020

Copy link to clipboard

Copied

I find AME menu ID as 3800. So i assume adding app.executeMenuCommand(3800); will not send project to AME which is already errors in its line. I cant find anything about it in AE Scripting guide.

 

Edit :

 

var myComp = app.project.activeItem;
var nameLayer = myComp.layer("City");
var theText = nameLayer.property("Source Text").value.text;
myComp.name = "Everything about" + theText;

app.executeCommand(3800);

 

This works. Will make it faster. Thank you for advice. Anything else you can say?

Likes

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
Reply
Loading...
Aug 29, 2020 0
Adobe Community Professional ,
Aug 29, 2020

Copy link to clipboard

Copied

Likes

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
Reply
Loading...
Aug 29, 2020 1
Adobe Community Professional ,
Aug 29, 2020

Copy link to clipboard

Copied

// Scripting support for Queue in AME.
// Requires Adobe Media Encoder 11.0.
if (app.project.renderQueue.canQueueInAME === true) {
    // Send queued items to AME, but do not start rendering.
    app.project.renderQueue.queueInAME(false);
} else {
    alert("There are no queued item in the Render Queue.");
}

Likes

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
Reply
Loading...
Aug 29, 2020 1
Adobe Community Professional ,
Aug 29, 2020

Copy link to clipboard

Copied

Of course, this requires to first put the comp in the render queue.

Likes

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
Reply
Loading...
Aug 29, 2020 1
Community Beginner ,
Aug 29, 2020

Copy link to clipboard

Copied

Thank you everybody for helping. You are good people. Special thanks to Nate who literally wrote it down for me to see how to import txt, evaluate and duplicate comps. Its solved. 

Likes

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
Reply
Loading...
Aug 29, 2020 0