Batch Clip Rename - Setting To Default
Hi Geniuses!
I have a script that calls up the Batch Clip Rename window (control+shift+R)
The first step is the script sets the window to Preset 1 (which is default setting)....i am using mouse click relative to UI element for this.
Problem is about 25% of the time the script crashes out here for no known reason.
I have a feeling this mouse click relative to UI command may just be a little funky in general.
Does anyone know of a better way to set the Batch Clip Rename window to the factory default after it opens?
Unfortunately, unlike a plugin, there is no way to tell the Batch Clip Rename window to always open in a default state..instead it always opens with the last settings that were used.
After the window is set to default settings, i use key-press commands to fill in the rest of the window accurately. This seems to work fine every time (even though I know this isn't the most elegant solution!)
Any help appreciated!
Script below
sf.keyboard.press({
keys: "ctrl+shift+r",
});
sf.ui.proTools.windows.whoseTitle.is("Batch Clip Rename").first.buttons.whoseTitle.is("Preset Toggle 1").first.mouseClickElement();
sf.ui.proTools.windows.whoseTitle.is("Batch Clip Rename").first.textFields.first.mouseClickElement();
sf.keyboard.press({
keys: "shift+minus, tab, space, tab, tab, 3, return, return",
});
- BBrandon Jiaconia @Brandon_Jiaconia
You can set a default preset by making sure everything is set the way it should be, then recall it at the start of your script. So in your script "sf.ui.proTools.windows.whoseTitle.is("Batch Clip Rename").first.buttons.whoseTitle.is("Preset Toggle 1").first.elementClick();" Would just recall the default preset, then set your actual preset to preset toggle number 2
- PPhilip weinrobe @Philip_weinrobe
Hi brandon!
That's the exact process i am using right now. Preset 1 is the default and then my scrpit sets everything
The problem is using mouseClickElement to click preset 1 is fairly unreliable so I was hoping there was another way, perhaps wit the SDK?, to call up the default preset without simulating a mouse click.thanks :)
Philip- BBrandon Jiaconia @Brandon_Jiaconia
Try using
sf.ui.proTools.windows.whoseTitle.is("Batch Clip Rename").first.buttons.whoseTitle.is("Preset Toggle 1").first.elementClick();
instead of
sf.ui.proTools.windows.whoseTitle.is("Batch Clip Rename").first.buttons.whoseTitle.is("Preset Toggle 1").first.mouseClickElement();
I use the first one regularly in Bounce Settings, Fades etc without issue. Might not be the solve, but the only difference I can see!
- PPhilip weinrobe @Philip_weinrobe
thank you! will try this in the morning :)
- OIn reply toPhilip_weinrobe⬆:Owen Granich-Young @Owen_Granich_Young
You might need to wait for the batch rename window
const sup = sf.ui.proTools sup.appActivateMainWindow(); function batchRename(clipName) { sup.menuClick({ menuPath: ['Edit', 'Consolidate Clip'], }) sup.menuClick({ menuPath: ["View", "Other Displays", "Clip List"], targetValue: "Enable" }) sup.mainWindow.popupButtons.whoseTitle.is("Clip List").first.popupMenuSelect({ menuPath: ["Batch Rename..."], }); const batchClipRenameWin = sf.ui.proTools.windows.whoseTitle.is('Batch Clip Rename').first.elementWaitFor({}, 'Bach Rename Window failed to open \nCheck clip selection.').element; batchClipRenameWin.buttons.whoseTitle.is("Preset Toggle 5").first.elementClick(); batchClipRenameWin.textFields.allItems[6].elementSetTextFieldWithAreaValue({ value: clipName, }) batchClipRenameWin.buttons.whoseTitle.is('OK').first.elementClick(); batchClipRenameWin.elementWaitFor({ waitType: "Disappear" }); }
Here's a snippet from a consolidate script I have. You'd have to parse out a little but it's a bit more stable then the Keyboard press to summon batch rename, and it has Wait for UI element for the batch window as well. This one is for preset 5 on line 18... and then i name some stuff, you could change 18 and delete 19-25 to go back to your keyboard press at your line 10... I think.
- PPhilip weinrobe @Philip_weinrobe
weird, when i run this script my pro tools starts playing but only for 1 second...no error thrown.
- OOwen Granich-Young @Owen_Granich_Young
whoa weird.... Also just realized you'll need to remove lines 6-8 as they are consolidates.... sorry I 'tried' to help by dropping you a piece of code but didn't do a very good job of checking it before I threw you to the wolves.