Asked by @Michaz_Wilczewski.
Linked from:
- Christian Scheuer @chrscheuer2020-06-18 18:31:33.162Z
Original question, moved from:
https://forum.soundflow.org/-124/how-to-change-options-in-preferences#post-18- MMichał Wilczewski @Michaz_Wilczewski
Hi everyone. This is my first time here, so dont be mad if i will write something stupid or in a wrong place. I have a problem, because I dont know, how to choose Clip Gain Nudge Value window to enter desired value. I want my script to ask for desired value of this Nudge and then do super quick setup.
Christian Scheuer @chrscheuer2020-06-18 18:34:19.904Z
Hi Michał. I moved your question to a new thread as the old one had already been answered.
The Clip Gain Nudge Value you want to set, where is that? Is that somewhere in preferences?
Can you share a screenshot?- MMichał Wilczewski @Michaz_Wilczewski
Christian Scheuer @chrscheuer2020-06-22 22:43:37.291Z
Great, thanks.
This should set it to 5 dB:
function openPrefs() { sf.ui.proTools.appActivateMainWindow(); //Open up Preferences sf.ui.proTools.menuClick({ menuPath: ['Pro Tools', 'Preferences...'] }); //Wait for Preferences window to appear var prefsWin = sf.ui.proTools.windows.whoseTitle.endsWith('Preferences').first; prefsWin.elementWaitFor(); } function setPrefTextField(tabName, groupName, textFieldIndex, textFieldValue) { var prefsWin = sf.ui.proTools.windows.whoseTitle.endsWith('Preferences').first; //Choose tab prefsWin.children.whoseTitle.startsWith(tabName).first.elementClick(); //Find group var group = prefsWin.groups.whoseTitle.is(groupName).first; //Find textField and click it group.textFields.allItems[textFieldIndex].elementClick(); sf.keyboard.type({ text: textFieldValue }); } function closePrefs() { //Click OK var prefsWin = sf.ui.proTools.windows.whoseTitle.endsWith('Preferences').first; prefsWin.buttons.whoseTitle.is("OK").first.elementClick(); //Wait for Preferences window to close prefsWin.elementWaitFor({ waitForNoElement: true }); } //Here you set your preferences: openPrefs(); setPrefTextField('Editing', 'Clips', 0, '5'); closePrefs();
- MMichał Wilczewski @Michaz_Wilczewski
This works great! Thanks :)
- In reply tochrscheuer⬆:LLawrence Kendrick @Lawrence_Kendrick
Hey Christian. This is great but doesn't work for 0.5. It just sets it to 5.0. Any suggestions for a workaround please?
- In reply toLawrence_Kendrick⬆:
samuel henriques @samuel_henriques
Hello,
I've changed Christian's code to do "0.5" as you asked. You can change the values "0" and "5" on the code to do whatever you want.
Be aware I'm very new with javascript and key pressing is very childish, but looks like it's working.
Apologies Christian, I hope you wont be mad with this.function openPrefs() { sf.ui.proTools.appActivateMainWindow(); //Open up Preferences sf.ui.proTools.menuClick({ menuPath: ['Pro Tools', 'Preferences...'] }); //Wait for Preferences window to appear var prefsWin = sf.ui.proTools.windows.whoseTitle.endsWith('Preferences').first; prefsWin.elementWaitFor(); } function setnudgevalue() { sf.keyboard.press({ keys: "tab", }); sf.keyboard.press({ keys: "0", }); sf.keyboard.press({ keys: "right", }); sf.keyboard.press({ keys: "5", }); } function closePrefs() { //Click OK var prefsWin = sf.ui.proTools.windows.whoseTitle.endsWith('Preferences').first; prefsWin.buttons.whoseTitle.is("OK").first.elementClick(); //Wait for Preferences window to close prefsWin.elementWaitFor({ waitForNoElement: true }); } //Here you set your preferences: openPrefs(); setnudgevalue(); closePrefs();
Christian Scheuer @chrscheuer2020-09-08 21:07:33.254Z
Hi @samuel_henriques. Haha no, definitely not mad - it's only great to see the community growing and people helping each other :) Thanks for sharing. This is very close to what I would have recommended :)
- In reply tosamuel_henriques⬆:LLawrence Kendrick @Lawrence_Kendrick
This is great and good info to know for further scripts, thanks for your help!
- In reply tosamuel_henriques⬆:
Chris Shaw @Chris_Shaw2024-03-26 16:54:32.132Z
This version will ask you for the nudge value before changing it - avoiding the need to change the script:
Pro Tools - Clip Gain Nudge Value #post-3