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
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);
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.
Copy link to clipboard
Copied
OK, I'm still missing something. How does the script know which files to apply it to?
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);
}
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...
Copy link to clipboard
Copied
Perfect! Thank you, this really helped a lot. I used the replaceWithPlaceholder();
It worked exactly how I wanted.
Thanks Dan!!!