Shortcut to a Preference setting

Hello!
Is there a way to make a Keybinding or Macro to a Preference setting?
I would like to quit enable/disable the
" editing a clip can move other clip" setting.
If not I strongly hope that this feature will be avaliable in the next Audacity version

You can create a keyboard shortcut to a Macro in the same way as creating a shortcut to an effect. See: https://manual.audacityteam.org/man/keyboard_preferences.html

To create a keyboard shortcut to change a Preference setting, you need to create a Macro to change the preference setting, and then create a shortcut to that Macro. The Macro command is:

SetPreference: Name= Value= Reload=<0 or 1>
See: https://manual.audacityteam.org/man/scripting_reference.html

Thank you for reply!

I think the solution is not a Macro
but a Script.

Setting i want to toggle is

EditClipCanMove (as in audacity.cfg)

values can be 1 (yes) 0 (no)

I set the script “set preference” name: EditClipCanMove value=1 reload (checked)

But it does NOT change the preference! Any help?
Thank you!

Create one macro containing the command:

SetPreference:Name="GUI/EditClipCanMove" Value="1"

and another containing the command:

SetPreference:Name="GUI/EditClipCanMove" Value="0"

The first enables the option, the second disables the option.
I’ve just tested after setting "Ctrl + " to enable, and “Ctrl + /” to disable. It works perfectly.

Thank you again but it’s not working for me.

My steps are

  1. menu tools/macro/new macro/
  2. macro name " move clip"
  3. insert command scrolling all avaliable commands i find “set preference”
  4. preference name “GUI\EditClipCanMove” or also GUI\EditClipCanMove or also EditClipCanMove
  5. value 1

save-

I launch Macro “move clip” but clips don’t move. ( in fact in preferences “move clips …”. is still unchecked)

It must be a forward slash after “GUI” like this:

Name="GUI/EditClipCanMove"

Oh yes!!! / and not \ !!! Works now!

Thank you so much for you help and patience!