Import Audio Macro
Hi there,
I hope everyone at Soundflow is doing well.
I've recently swapped to a new Mac and have to run Catalina and some of my shortcuts have broken as a result.
I used to have an Import Audio Macro based on key stroke shortcuts, but this no longer works because return doesn't press the 'Done' button in the Import Audio window. The following windows work fine.
Is there a way to press that pesky button?
Thanks.
- Raphael Sepulveda @raphaelsepulveda2020-10-11 21:54:18.251Z
Hello Martin!
Add this line to your script replacing the keystrokes:
sf.ui.proTools.windows.whoseTitle.is('Open').first.buttons.whoseTitle.is('Done').first.elementClick({});
As a rule of thumb it is best to use SoundFlow's Click UI Element action to find a button to click as opposed to simulating keystrokes to avoid errors like these!
- MMartin Pavey @Martin_Pavey
Thanks Raphael,
That bit works great.
Here is what I have now but the last part doesn't work.
It waits for the 'Audio Import Options' window to appear but SF doesn't see the window when it does pop up.sf.keyboard.press({ keys: "cmd+c", }); sf.ui.proTools.windows.whoseTitle.is('Open').first.buttons.whoseTitle.is('Done').first.elementClick({}); sf.ui.proTools.windows.whoseTitle.is('Open').first.children.whoseRole.is("AXStaticText").whoseValue.is('Choose a destination folder').first.elementWaitFor(); sf.keyboard.press({ keys: "return", }); sf.ui.proTools.windows.whoseTitle.is('Audio Import Options').first.getElement('AXTitleUIElement').elementWaitFor({ timeout: 10000, }); sf.keyboard.press({ keys: "return", });
samuel henriques @samuel_henriques
Hello Martin,
try this,sf.ui.proTools.windows.whoseTitle.is('Open').first.buttons.whoseTitle.is('Done').first.elementClick({}); sf.ui.proTools.windows.whoseTitle.is('Open').first.elementWaitFor({ waitType: "Appear", }); sf.ui.proTools.windows.whoseTitle.is('Open').first.buttons.whoseTitle.is('Open').first.elementClick();
- MIn reply toMartin_Pavey⬆:Martin Pavey @Martin_Pavey
Hi Samuel,
Nope still doesn't work, sorry.
It's this window I'm trying to wait for while the import audio process bar is running.
Thankssamuel henriques @samuel_henriques
cool, was on another import audio.
you want always clip list?samuel henriques @samuel_henriques
this is for clip list
sf.ui.proTools.windows.whoseTitle.is('Audio Import Options').first.elementWaitFor({ waitType: "Appear", }); sf.ui.proTools.windows.whoseTitle.is('Audio Import Options').first.radioButtons.first.checkboxSet({ targetValue: "Enable", }); sf.ui.proTools.windows.whoseTitle.is('Audio Import Options').first.buttons.whoseTitle.is('OK').first.elementClick();
- MMartin Pavey @Martin_Pavey
Yes I always use clip list.
Ah ha! that works great, thanks for your help on this Samuel and Raphael.
Here's the whole thing if anyone else finds it useful.
sf.keyboard.press({ keys: "cmd+c", }); sf.ui.proTools.windows.whoseTitle.is('Open').first.buttons.whoseTitle.is('Done').first.elementClick({}); sf.ui.proTools.windows.whoseTitle.is('Open').first.elementWaitFor({ waitType: "Appear", }); sf.ui.proTools.windows.whoseTitle.is('Open').first.buttons.whoseTitle.is('Open').first.elementClick() sf.ui.proTools.windows.whoseTitle.is('Audio Import Options').first.elementWaitFor({ waitType: "Appear", }); sf.ui.proTools.windows.whoseTitle.is('Audio Import Options').first.radioButtons.first.checkboxSet({ targetValue: "Enable", }); sf.ui.proTools.windows.whoseTitle.is('Audio Import Options').first.buttons.whoseTitle.is('OK').first.elementClick();
- MMartin Pavey @Martin_Pavey
Ps..
For anyone that doesn't get what it does.
You select the file or files in the import window that you want to import and then run the macro.samuel henriques @samuel_henriques
Cool, happy it works.
I'm used to drag to the session or clip list, but sometimes it will be usefull.Have fun!
- In reply toMartin_Pavey⬆:
samuel henriques @samuel_henriques
You can do this, using the same trigger.
If the Import audio window is not there it will open in, when its opened, select your files and press again.if (sf.ui.proTools.windows.whoseTitle.is('Open').first.buttons.whoseTitle.is('Done').exists){ sf.ui.proTools.windows.whoseTitle.is('Open').first.buttons.whoseTitle.is('Copy ->').first.elementClick(); sf.ui.proTools.windows.whoseTitle.is('Open').first.buttons.whoseTitle.is('Done').first.elementClick({}); sf.ui.proTools.windows.whoseTitle.is('Open').first.elementWaitFor({ waitType: "Appear", }); sf.ui.proTools.windows.whoseTitle.is('Open').first.buttons.whoseTitle.is('Open').first.elementClick() sf.ui.proTools.windows.whoseTitle.is('Audio Import Options').first.elementWaitFor({ waitType: "Appear", }); sf.ui.proTools.windows.whoseTitle.is('Audio Import Options').first.radioButtons.first.checkboxSet({ targetValue: "Enable", }); sf.ui.proTools.windows.whoseTitle.is('Audio Import Options').first.buttons.whoseTitle.is('OK').first.elementClick(); }else{ sf.ui.proTools.menuClick({ menuPath: ["File","Import","Audio..."], }); }
- MMartin Pavey @Martin_Pavey
Now, that is very cool!
Thanks for that Samuel, I'll give it a try.
M - In reply tosamuel_henriques⬆:OOwen Granich-Young @Owen_Granich_Young
Hey @Samuel this is awesome, I need some help tweaking the ELSE part if you have a free moment. And to be honest I'm sure there's a cleaner way of navigating to the STEMS folder, I'm just not quite up to snuff.
I use Soundminer Radium to sound design all the time, but I need to use the STEMS all the time so my mixer has more flexiblity.
So I've built a script using Christians navigate to session folder command, and then key commands to navigate to the Audio Files folder, then to STEMS folder from there. But when I shove that into the ELSE command it doesn't take.A. How do I need to format this (because I literally have no idea what I'm doing) to get it to sit in the ELSE part of your script?
B. Is there a cleaner way to navigate to STEMS folder for current session (ie not key presses), it will always be in the Audio Files folder of current session?
C. DREAM SETUP Soundflow knows to grab the last modifed files in the folder (a variable number since there's variable stems per radium build) and import those so this is all on one button press?
Here's my clunky navigate to stems folder Script that's been working but I don't quite get how to get it to live in the }else{ :
sf.ui.proTools.menuClick({
menuPath: ["File","Import","Audio..."],
});//Calling command "Navigate to Folder of Current Session" from package "Pro Tools Utilities" (installed from user/pkg/version "srAasovvDiQacRZ2mcId4RrOA8R2/ck1w23x1o0000ef10gotnvo1z/cko4vno0300016y10lm312ray")
sf.soundflow.runCommand({
commandId: 'user:ckrzeoq180001b4103nnk3xd9:ck1w41c8u0015ef10kd27lzs8',
props: {}
});sf.keyboard.press({
keys: "a, u, cmd+down, s, t, e, m, s, cmd+down",
});samuel henriques @samuel_henriques
Hello Owen Granich-Young,
it seams to me that you want a script to :
open import audio window
navigate to stems folder
select the latest createdthen you could check if selection is correct and press open
what is the normal path and name of the STEMS folder?
In the mean time you can check this video on how to quote code in the forum:
How to quote code in the SoundFlow forum.Let me know if I didn't understand it well.
I think it's better fi you could open a new thread, What you are asking is fairly different from this one, just so it makes it easier to search in the future.- OOwen Granich-Young @Owen_Granich_Young
I saw that it didn't quote correclty, I'll check that link out thanks!
IE: I still know nothing :)
I'd be happy to skip the check step and have it do it all in one go TBH.
I'll Make a new thead now and @ you
- MIn reply toMartin_Pavey⬆:Martin Pavey @Martin_Pavey
I just tried it. Super slick.
Thanks so much.samuel henriques @samuel_henriques
Cool!