Hei!
I'd like to have a custom toolbar button that toggles a configuration setting. In particular, I would like to toggle "General > Tree and List > Tree > Check existence of subfolders in tree > In network locations as well".
Is there any way to do that?
[Q] How to make custom button to toggel configuration settings?
Re: [Q] How to make custom button to toggel configuration settings?
There's no "setting" script command or tweak for what you're looking for, but you can achieve it using the sendkeys command. Of course, the Configuration dialog box will flicker a moment since the script is changing a Configuration setting and it's doing it in your face. You can assign the first one, which I believe is what you are after, to a UDC or CTB.
Code: Select all
// this script will cycle "In network locations as well" in Configuration > Tree and List regardless of the Check existence of subfolders in tree setting
sendkeys '{PGUP}%w{ }{ENTER}';#600; // to cycle "In network locations as well"
// this script will cycle "Check existence of subfolders in tree" regardless of the "In network locations as well" setting
sendkeys '{PGUP}%k{ENTER}';#600; // to cycle "Check existence of subfolders in tree"
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440
Re: [Q] How to make custom button to toggel configuration settings?
I don't need to toggle this setting often, and your sendkeys approach is doing a perfectly fine job.
Thank you so much
Thank you so much
-
- Site Admin
- Posts: 60644
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: [Q] How to make custom button to toggel configuration settings?
klownboy, could you explain what the script is doing?
FAQ | XY News RSS | XY Twitter
Re: [Q] How to make custom button to toggel configuration settings?
It's not doing anything too exciting just sending keystrokes into the Configuration dialog which I've found in the past you have to send or feed before the CID #600 that opens Configuration.
- {PgUp} makes sure we are at the Tree and List in the General section (i.e., the top). I'd use {Home} instead but it does not work properly.
- %w sends the cursor down to the first "w" accelerator, "In network locations as well"
- { } sends a space character to check that setting. {Space} does not work.
- {Enter} is then sent to finalize and close the Configuration dialog.
There was a lot of trial and error took place before I posted this - mostly "Error 5" concerning the use of sendkeys {Home} and {Space}.
"%w" would activate the setting as well if there was only one instance of accelerator "w", but you have 2 "w" accelerators in that section, so it only goes to the setting and does not activate or check it. It does in the case of "%k" in the other example since there is only one instance of "k".
- {PgUp} makes sure we are at the Tree and List in the General section (i.e., the top). I'd use {Home} instead but it does not work properly.
- %w sends the cursor down to the first "w" accelerator, "In network locations as well"
- { } sends a space character to check that setting. {Space} does not work.
- {Enter} is then sent to finalize and close the Configuration dialog.
There was a lot of trial and error took place before I posted this - mostly "Error 5" concerning the use of sendkeys {Home} and {Space}.
"%w" would activate the setting as well if there was only one instance of accelerator "w", but you have 2 "w" accelerators in that section, so it only goes to the setting and does not activate or check it. It does in the case of "%k" in the other example since there is only one instance of "k".
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440
-
- Site Admin
- Posts: 60644
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: [Q] How to make custom button to toggel configuration settings?
Pretty confusing that you feed the keystrokes before opening the dialog.
FAQ | XY News RSS | XY Twitter
-
- Posts: 225
- Joined: 29 Sep 2022 14:20
- Location: Win10 @125%
Re: [Q] How to make custom button to toggel configuration settings?
is this a chance for a new scripting command ? maybe togglesetting() ? i am assuming that every configuration setting has a number assigned to it internally. if that is the case you could togglesetting(600); and it would flip the existing setting regardless of what it is set. if checked, uncheck. if unchecked, check.
-
- Site Admin
- Posts: 60644
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: [Q] How to make custom button to toggel configuration settings?
Your assumption is true for menu commands but not for settings.
FAQ | XY News RSS | XY Twitter
Re: [Q] How to make custom button to toggel configuration settings?
Yes, it is a bit odd, but I assume those keystrokes are are being saved in memory to be fed into the Configuration dialog when it opens. It just doesn't work the other way around...too late I guess. I found that out using List Management CIDs as well (e.g., #614, #632, #624.). You have to feed the keystrokes into those dialog boxes before you call the CID.
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440