Page 1 of 1

TB Cycle with Indicator [script]

Posted: 06 Mar 2022 14:58
by klownboy
At first I was thinking, seeing the button set number on the toolbar was really not necessary. I still think that, but I'm starting to like the idea, necessary or not. This is my version of a Toolbar Cycle with Indicator. The script will cycle toolbars along with having visual indication of the current toolbar set number on the CTB. No dropdown menus; just click on the CTB. You can also use the same script to cycle toolbars with a User Defined Command (UDC) and have the same visual indicator on the CTB you've set up. In use, the UDC actually may be the better operationally. It will work whether you have 2, 3, or 4 toolbars.

- Place the script in you script folder and place the 4 icons included in your <xyicons> folder. I really like Kunkel's white version numbers. They look great going from light to dark modes. Thanks Kunkel.
- Make a new CTB with a name of "Toolbar Set #1". Though the name actually doesn't matter at this point. For left click assignment use:
load "<xyscripts>\TB Cycle with Indicator.xys"; You can leave the icon field blank.
- You'll have to add the same CTB to each of your toolbars. It makes sense to place them in the same position left-to-right.
- The first run only, the script will determine the CTB number and insert it in the script.
- For a UDC, select the "Load script file" option and for the name enter "TB Cycle with Indicator" and for the Script File enter,
"<xyscripts>\TB Cycle with Indicator.xys" (no quotes). I set my key assignment as Numpad 5.
- Important - For the first run, click on the CTB such that the CTB index is established). For subsequent runs click on either the CTB or run the UDC.
- If you want to use your own icons, simply change them on lines 31-34.

The script uses a heredoc technique similar to TheQwerty's Gallery Wall script. Thanks TheQwerty.
Please let me know if you have any issues. Thanks.
TB Cycle with Indicator_01.jpg
TB Cycle with Indicator_01.jpg (11.19 KiB) Viewed 2621 times
TB Cycle with Indicator_02.jpg
TB Cycle with Indicator_02.jpg (21.88 KiB) Viewed 2621 times

Re: TB Cycle with Indicator [script]

Posted: 06 Mar 2022 15:22
by Horst
Thanks for this script.
Works fine here.

Re: TB Cycle with Indicator [script]

Posted: 06 Mar 2022 15:34
by klownboy
Thanks Horst for the feedback.

Re: TB Cycle with Indicator [script]

Posted: 06 Mar 2022 18:56
by klownboy
By the way, if you would rather not see the affect of the CBTstate changing (i.e., the background on the CTB) just comment out the 2 lines very near the end of the script. Like so:

Code: Select all

//  $CTB_State = GetToken($newState, 2, '|');
//  CtbState($CTB_State,$ctbindex);
I debated taking that out initially.

Re: TB Cycle with Indicator [script]

Posted: 06 Mar 2022 19:23
by Horst
klownboy wrote: 06 Mar 2022 18:56 By the way, if you would rather not see the affect of the CBTstate changing (i.e., the background on the CTB) just comment out the 2 lines very near the end of the script. Like so:
I don't see any background effect with that change.
What should I see with this lines enabled or disabled ?
May be my system is to fast :)

Re: TB Cycle with Indicator [script]

Posted: 06 Mar 2022 20:04
by klownboy
Horst wrote: 06 Mar 2022 19:23 I don't see any background effect with that change.
No, before commenting out those 2 lines when cycling the toolbars back and forth you may have noticed the background of the CTB changing sightly due to a CTBstate change (i.e., the affect you normally see when you make a toolbar button activate or not). I think you would have noticed the active or inactive background affect whether in light or dark mode. You would notice the CTB button background affect (active), not during the change, but after changing to button set #2 or button set#4.

Re: TB Cycle with Indicator [script]

Posted: 06 Mar 2022 20:22
by Horst
Ok, now I understand and see.
I left the 2 lines commented out now.