Title
script doesn't do the good keyboard map.
What do you expect to happen when you run the script/macro?
in pro tools : mute cue
Are you seeing an error?
What happens when you run this script?
The script makes cmd+, (command + coma) = remove sync point
not "command+m" as expected.
How were you running this script?
I clicked the "Run Script" or "Run Macro" button in SoundFlow
How important is this issue to you?
3
Details
{ "inputExpected": "in pro tools :\nmute cue", "inputIsError": false, "inputWhatHappens": "The script makes cmd+,\n(command + coma) = remove sync point\n\nnot \"command+m\" as expected.", "inputHowRun": { "key": "-MpfwYA4I6GGlXgvp5j1", "title": "I clicked the \"Run Script\" or \"Run Macro\" button in SoundFlow" }, "inputImportance": 3, "inputTitle": "script doesn't do the good keyboard map.\n" }
Source
//open Protools
sf.app.launch({
path: "/Applications/Pro Tools.app",
});
//Mute the current clip
sf.keyboard.press({ keys: 'cmd+m' });
Links
User UID: oC1NWe1MNsc3zyhqLPAbseJiZAf2
Feedback Key: sffeedback:oC1NWe1MNsc3zyhqLPAbseJiZAf2:-NgnlPYkoCTF8raTAjVb
Feedback ZIP: P9QqFBMQvw2vxusnX+tcniHl67jhBmqG7a6WFP1B6KMWWxi3c990T/Tt9xIyjmGqTzOC8oEVz9ASUdM7wV5+R9jf45rFNevfijGh3BGdt9ypnOJ5Aa3sWVb6uP+wgtNaSqwVuCjOaLYVps8pohfYsBB7xF9TOv4+U8B1nKCG7NKgdKSfXJvgq+SWYsZzbT7Bl6CAz9FXlUxFCRICXrbk2npm/dw0QGY5frCcTUzBTyb3OYU2yqjSQCHIlU26QjJf+Ey0MSgj2FHKGYg0gpMHF8PfjVEuYL/oyk8KZPdIcib1qoEkK8/z6FoOJ7DbMIoAvhRqWqLdFxDx+Rmwa/k0mGbEUAyQWknmTSBLwSy5TMo=
- Chris Shaw @Chris_Shaw2023-10-16 17:25:37.326Z
this should do it:
This script will mute clips if they are unmuted and unmute them if they are muted://activate Pro Tools sf.ui.proTools.appActivate(); //Check if clip is unmuted by checking if "Mute Clip" exist in menu let isUnmuted = sf.ui.proTools.getMenuItem("Edit", "Mute Clips").exists if (isUnmuted) { //Mute selected clip(s) sf.ui.proTools.menuClick({ menuPath: ["Edit", "Mute Clips"] }) }else{ sf.ui.proTools.menuClick({ menuPath: ["Edit", "Unmute Clips"] }) }
If you don't want to unmute clips then use this:
//activate Pro Tools sf.ui.proTools.appActivate(); //Check if clip is unmuted by checking if "Mute Clip" exist in menu let isUnmuted = sf.ui.proTools.getMenuItem("Edit", "Mute Clips").exists if (isUnmuted) { //Mute selected clip(s) sf.ui.proTools.menuClick({ menuPath: ["Edit", "Mute Clips"] }) }
- In reply tomikael_barre⬆:Chris Shaw @Chris_Shaw2023-10-16 17:30:48.973Z
I noticed that you filed an issue about this script here:
french azerty keyboard and scriptThe script above should fix the issue because it's using menu commands instead of keyboard presses.
Generally speaking, you should avoid using keyboard simulations in your scripts because they are not as reliable as menu click actions
- Mmikael barre @mikael_barre
Thanks Chris,
Your solution works.
But it's true that my concern was more about azerty keyboard, and the "mute" script was only to make obvious the problem.I noticed that if i change in the Keyboard menu of pro tools, to switch to US keyboard, then the script with the keyboard command was working as expected. So i was thinking to implement new lines to switch to US keyboard inside of pro tools, at the beginning of the script then put again the azerty keyboard at the end of the script, but the menu solution is better of course.
In fact the script i wanted to do is :
- copy the cue to the following track (cmd+c and "m" if focus is on in the edit window
- mute the cue in that track
- reselect the cue in the 1st track and send it to RX advanced.
There are some scripts that send the cue to a track named "unprocessed 1" or so, i just wanted to make it more close to how i'm working without soundflow, but i guess it's not a good idea.
And by the way i don't know how to script edit focus keyboard action when i'm not sure where to find the same action in the menu.
for exemple the very simple action to go to the next track, which is just "m" in azerty keyboard, or "p" to go to th above track would be very useful for me because i'm using it a lot when i do repeatable things that i would be very happy to have scripts for.anyway thanks a lot !