Page 1 of 1
Any way to toggle "Show file info tips" via script?
Posted: 24 Jul 2024 04:23
by o7blue
I would like to be able to quickly toggle file info tips on and off, through a button that invokes a script or command. Is that at all possible?
Re: Any way to toggle "Show file info tips" via script?
Posted: 24 Jul 2024 15:33
by Norn
Re: Any way to toggle "Show file info tips" via script?
Posted: 24 Jul 2024 18:34
by klownboy
Which is fine for Hover Box (HB)
button "hb";, but it would be nice if there was an equivalent toolbar or scripting command specifically for info tip (IT). So, maybe we should be looking for a new SC
setting command, one which would have a flag for toggling "HB" or "IT".
EDIT: The suggestion to have a setting command to toggle the Hover Box or the Info Tip would still be great, but until then this works for:
File Info Tip toggle:
sendkeys "{Enter}";button "hb","2";
Hover Box toggle:
button "hb";
You can assign a separate UDC for toggling File Info Tips or Hover Box or both. I initially thought I had to send a sendkeys "{DOWN}" before the {Enter}, but since a right click on the Hover Box button is initially on the first menu item, which is on "Show File Info Tips", the {DOWN} isn't required.
Re: Any way to toggle "Show file info tips" via script?
Posted: 24 Jul 2024 22:57
by o7blue
klownboy wrote: ↑24 Jul 2024 18:34
I initially thought I had to send a sendkeys "{DOWN}" before the {Enter}, but since a right click on the Hover Box button is initially on the first menu item, which is on "Show File Info Tips", the {DOWN} isn't required.
After trying for a bit I actually had to put in the {DOWN} for the UDC to work. That said I'd rather tie it to a button than a UDC, so I have a custom button load this script:
Code: Select all
sendkeys "{DOWN}";
sendkeys "{Enter}";
button "hb","2";
I would have never guessed that I have to send the keystrokes before the button command, I'm downright surprised that works. In any case, thank you very much for pointing the way here. The hover box toggle alone was not applicable since it's the info tips that contains the info I want to toggle. As far as I know there's no way to display the info tips data in the hover box, right?
Re: Any way to toggle "Show file info tips" via script?
Posted: 25 Jul 2024 01:18
by klownboy
Yeah, for me it does not work with {Down}. Must be something with the Configuration or my setup possibly that makes the first item in the menu (Show File Info Tips) react without {Down}. In any case, you should be able to combine the sendkeys statements to one. sendkeys "{Down}{Enter}";button "hb","2"; or if you kept the UDC even though you're using a CTB, you can simply use the user CID displayed for the UDC (e.g., #1478;).
Re: Any way to toggle "Show file info tips" via script?
Posted: 25 Jul 2024 03:38
by o7blue
Thanks for the tips! Incorporated those and also added a state toggle for the button itself, so it's easier to tell when it's on (adds the visual effect of being pressed down or not).
Code: Select all
perm $file_info_toggle_state = !$file_info_toggle_state;
if ($file_info_toggle_state) {
ctbstate(1, 9);
}
else {
ctbstate(0, 9);
}
sendkeys "{DOWN}{Enter}";
button "hb","2";
Not sure why we have different experiences with {DOWN} (I'm on windows 10, not sure if that's at all relevant here), but the important part is that it's documented here.