• 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 trying to app.executeCommand() a selected file

Community Beginner ,
Dec 14, 2021 Dec 14, 2021

Copy link to clipboard

Copied

hello community,

I'm trying to write a script where I could execute a app.executeCommand() to a specific file selected.

For example, if I want to "Apply Interpretation" | app.executeCommand(2255); to a selected clip or group of clips.

Please if anybody can help I would really appreciate it.
@Dan Ebberts 

TOPICS
Expressions , Scripting

Views

429

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
Community Expert ,
Dec 14, 2021 Dec 14, 2021

Copy link to clipboard

Copied

I must not be understanding what you're asking, because if you have a group of clips selected in the project panel, I think that's all you need to do (assuming you have previously done Rember Interpolation):

 

app.executeCommand(2255);

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
Community Beginner ,
Dec 14, 2021 Dec 14, 2021

Copy link to clipboard

Copied

Yes, 

If I do a "Remember Inter..." then want to apply it to the files that had a specific extension. (Ex. .mp3 or .mov, etc.) using the app.executeCommand(), instead of selecting them one by one.

Lately, I've been working on projects that had a lot of files, and sometimes the settings are off. It's a pain to select them one by one instead of having them automated.

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
Community Expert ,
Dec 14, 2021 Dec 14, 2021

Copy link to clipboard

Copied

OK, I'm still missing something. How does the script know which files to apply it to?

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
Community Beginner ,
Jun 15, 2022 Jun 15, 2022

Copy link to clipboard

Copied

I hope you can answer this question; Sorry for the super delay.
This is a good example of what im trying to do... but with Replace Footage...

 

But I'm trying to assign the app.command to a selected layer, but i can't figure that part out.

 

var mainWindow = new Window ("palette", "Replace Footage", undefined);
mainWindow.orientation = "row";
var placeholderBtn = mainWindow.add("button", undefined, "Replace/Placeholder");

mainWindow.center();
mainWindow.show();

placeholderBtn.onClick = function(){
var selctLay = app.project.selection;
app.executeCommand(2126);
}

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
Community Expert ,
Jun 15, 2022 Jun 15, 2022

Copy link to clipboard

Copied

For a selected layer, you would just use the replaceSource() method--you wouldn't need a menu command for that. If you're talking replacing a selected footage item in the project panel, you'd just use the replace() method. If you did actually execute the Replace Footage>File... menu command, I think you'd just trigger the file navigation dialog and the script wouldn't be able to help you with that. Unless I'm completely misunderstanding what you're trying to accomplish...

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
Community Beginner ,
Jun 15, 2022 Jun 15, 2022

Copy link to clipboard

Copied

LATEST

Perfect! Thank you, this really helped a lot. I used the replaceWithPlaceholder();

It worked exactly how I wanted.

Thanks Dan!!!

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