Hey autocart thanks for the interest. My main goal in the XY script was to use a single script to switch toolbars whether it be by scrolling or UDC or CTB. Regardless of the method used, it will change the CTB indicating the toolbar button set #. And for my use, I have the address bar displayed only on toolbar button set #2 Line #1. You can obviously do something different.
Important: the script must be first run from the CTB (not scrolling or UDC so that the CTB index is obtained)
Assigments in CTB and UDCs(2):
CTB name "TB Cycle with Indicator" in left and right click:
load "<xyscripts>\TB Cycle with Indicator.xys";
UDC name: "TB Cycle with Indicator in "Run script" category:
load "<xyscripts>\TB Cycle with Indicator.xys"; I have it set to Numpad5
UDC name: "TB Cycle with Indicator- scrolling" in "Load script file" category:
global $UDC="1";load "<xyscripts>\TB Cycle with Indicator.xys"; I have this set to Control Alt Numpad5. This is the key combo actuated by AHK (see my previous AHK script post)
Code: Select all
global $UDC;
$loc = ControlatPos();
$trigger = get("trigger","mousebtn");
$ctbindex = "unknown";
//*** On first run only, determine & set CTB index [$ctbindex below] based on CTB name
//*** So we can use this in a UDC as well as a CTB. Run this script from CTB first
//*** If you want to simply put in your $ctbindex above, you can delete this section
if($ctbindex LikeI "unknown") {
$self = self("file");
$toolbar = toolbar();
$name_CTB = ctbname();
foreach($button, $toolbar, ",") {
if(substr($button, 0, 3) LikeI "ctb") {
$ctbI = trim($button, "ctb", "L");
if(ctbname( , $ctbI) == "$name_CTB") {
$ctbindex = $ctbI; break;
}
}
}
$content = replace(readfile($self), "unknown", "$ctbindex", , 1, 1);
writefile($self, $content);
}
if($UDC == "1" AND !$trigger) { //if scrolled $trigger will be "0"
ButtonSet(-1); //or use: button "tbs"; with same result
}
elseif(!$trigger AND gettoken($loc, "1", "|") LikeI "T*") {
}
else {
ButtonSet(-1);
}
$n = ButtonSet();
if($n == "1") {
if(get("#660")) {#660;} // setlayout("ShowAddressbar=1");
}
elseif($n == "2") {
if(!get("#660")) {#660;} // setlayout("ShowAddressbar=1");
}
ctbname("Toolbar Set #" . $n, $ctbindex);
ctbicon("label: $n >554433,FFF2F2", $ctbindex);