Scripting the Tab Background Color

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Mr_Inc
Posts: 13
Joined: 27 Sep 2010 13:17

Scripting the Tab Background Color

Post by Mr_Inc »

Is it possible to script the #542 Command to set the tab background color?

Thanks

highend
Posts: 14571
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Scripting the Tab Background Color

Post by highend »

Internal command IDs can't be modified if you're asking that this command sets the background color to some user defined value...
One of my scripts helped you out? Please donate via Paypal

Mr_Inc
Posts: 13
Joined: 27 Sep 2010 13:17

Re: Scripting the Tab Background Color

Post by Mr_Inc »

Thank you. I thought that was the case!

Any other way to do it 'programmatically" via a script?

highend
Posts: 14571
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Scripting the Tab Background Color

Post by highend »

tab() can do it, I guess. Never tried that though
"textcolor", "backcolor" = sets the custom text/background color of a tab

data: color value in hexadecimal format (RRGGBB) (if empty then any custom color is removed)

index: tab to color (if missing then current tab)

return: index of the affected tab
One of my scripts helped you out? Please donate via Paypal

klownboy
Posts: 4397
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440

Re: Scripting the Tab Background Color

Post by klownboy »

Try something like this using sendkeys:

Code: Select all

  seltab '11';  //whatever tab index you're changing left most tab is '1' and so on
  sendkeys "D7D7FF{Enter}";#542;  //D7D7FF is in the hexadecimal format for the color code you want
You could automate it further and change a bunch of tab colors.

Edit: The better way to do it is using SC tab() as highend recommended above. The screen could flicker a little using sendkeys especially on a slower computer.

Code: Select all

 tab("backcolor","FFB9DC", 6);   // '6' in this case is the index 

Mr_Inc
Posts: 13
Joined: 27 Sep 2010 13:17

Re: Scripting the Tab Background Color

Post by Mr_Inc »

Is there a similar feature to script for the colors of the breadcrumb on each Pane?

klownboy
Posts: 4397
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440

Re: Scripting the Tab Background Color

Post by klownboy »

There is no tab() like command for the breadcrumb bar. You can set the colors via SC setkey command to modify the XYplorer.ini file but changing these values with setkey will require a save.

Code: Select all

//setkey value, key, section, [INIfile], [flags]   from the help file
  setkey "FFB9DC", "clrCrumb1ActiveBack", "Settings";  // BC active background
  setkey "FFB9DC", "clrCrumb2ActiveBack", "Settings";  // BC inactive background
This will change the background of the active pane BC1 background. The screen may flicker slightly but it will change immediately:

Code: Select all

 sendkeys "{HOME}ccc{tab 27}^aFFB9DC{Enter}";#600;
For the active BC2 pane:

Code: Select all

 sendkeys "{HOME}ccc{tab 31}^aFFB9DC{Enter}";#600;
You can get the other inactive BC background color "keys" from the XYplorer.ini file.

Mr_Inc
Posts: 13
Joined: 27 Sep 2010 13:17

Re: Scripting the Tab Background Color

Post by Mr_Inc »

Thanks.

Post Reply