Page 1 of 2
Command without ID to CTB?
Posted: 05 Jul 2014 15:29
by Stef123
How do I get commands onto my CTB that don't have an ID assigned?
For instance: I often need to change my backup settings. Right-clicking the built-in rfo-button has an entry "Configure Backup..."
How do I get this onto my CTB?
Re: Command without ID to CTB?
Posted: 05 Jul 2014 15:41
by bdeshi
Assuming you use XYplorer in English,

Re: Command without ID to CTB?
Posted: 05 Jul 2014 15:49
by Stef123
Throws an error - apparently it is attempting to enter the letters as "Type Ahead"
SendKeys sounds like a rather crude BruteForce launch - probably totally dependent on my interface settings - Do you mind elaborating a bit?
Re: Command without ID to CTB?
Posted: 05 Jul 2014 15:59
by bdeshi
Hmm.... what happens with just
::sendkeys "{F9}"; ? or
::sendkeys "%F"; ?
Explanation:
It's
should send these keys: F9, M, F, F, ALT+N.
Code: Select all
F9 = opens the config.
M = goes to "Menu, mouse, safety". Its the only config sidebar item that starts with a unique letter.
To make sure subsequent letter-based sidebar navigation will be spot-on.
F = goes to "Fonts"
F = goes to "File Operations"
Alt+N= triggers the first "Configure" button, which is under "Backup Operations."
Re: Command without ID to CTB?
Posted: 05 Jul 2014 16:05
by Stef123
And once again I have to ask you: Where on earth do you find all this stuff, Sammay?
Searched help for "sendkeys" - nothing
I have assigned Ctrl K to Config (to be consistent with Photoshop and Co) - how would I enter Ctrl K?
And also: My config comes up with the last category selected (I like that) - wouldn't that mean that pressing F twice might land me on a very wrong entry on occasion?
Re: Command without ID to CTB?
Posted: 05 Jul 2014 16:10
by bdeshi
Okay, try this then:
====
"
Where on earth do you find all this stuff, Sammay?
"

*
"
And also: My config comes up with the last category selected (I like that) - wouldn't that mean that pressing F twice might land me on a very wrong entry on occasion?"
— That's the reason we have to start with a unique item: with the M.
*somebody made a nice sendkeys documentation around here. Funny, I couldn't find it either...
Re: Command without ID to CTB?
Posted: 05 Jul 2014 16:33
by Stef123
SammaySarkar wrote:That's the reason we have to start with a unique item: with the M.

Took a moment to register - synaptically speaking - then my neurons fired. Smart trick - another one to remember.
It works now, "almost" as good as the real thing (which doesn't require me to confirm two dialogs) - but hey, good enough - much appreciated. Thanks.
Should you come across the sendkeys documentation - would you please share the link?
Re: Command without ID to CTB?
Posted: 05 Jul 2014 16:56
by bdeshi
Thanks.
Well, couldn't find anything in the forum yet, but the sendkeys command is inherited from vb6:
http://msdn.microsoft.com/en-us/library ... 60%29.aspx
Everything on that link applies to XY. (with the possible exception of the wait parameter, which is irrelevant anyways.)
syntax is
Code: Select all
sendkeys "keystring(s)"; // learn about the keystrings from the link above
examples:
Code: Select all
//command; //output
sendkeys "a"; //a
sendkeys "QwErtY"; //QwErtY
sendkeys " q"; //space, then q
sendkeys "+a"; //SHIFT+a
sendkeys "^a"; //CTRL+a
sendkeys "%hX"; //ALT+h, then X
sendkeys "{tab}~"; //the tab key, then enter
sendkeys "{tab}{Enter}"; //tab key, enter key
sendkeys "{~}{%}"; //~%(NOT enter then alt)
sendkeys "{F9}"; //F9 key
sendkeys "{{}"; //{
sendkeys "Wo{W 5}"; //WoWWWWW
sendkeys "XYZ{BS}plorer"; //XYplorer
Experiment.
[quickfind tags: sendkeys syntax sendkeys documentation]

Re: Command without ID to CTB?
Posted: 05 Jul 2014 17:17
by SkyFrontier
For the sake of documentation,
this post has a few more hints on sendkeys.
-is this the post you're referring to, Sammay?
Re: Command without ID to CTB?
Posted: 05 Jul 2014 17:32
by bdeshi
Almost, but no, I remember there was a all-english post too...
Re: Command without ID to CTB?
Posted: 05 Jul 2014 17:38
by Stef123
Thanks guys,
glad I tinkered with AHK lately - otherwise this would be way over my head.
Since this does not seem to be officially endorsed by XY - any risks I need to be aware of? I realize that reassigning shortcuts might trigger something uncalled for - but I won't change Ctrl K anyway. Other than that, anything else there is to know?
Re: Command without ID to CTB?
Posted: 05 Jul 2014 17:47
by bdeshi
Sendkeys sends the keys just fine. Invalid strings inside curly braces will trigger an error (example: ::sendkeys "{NOTHING}") nothing serious though.
just one more thing: DO NOT try anything like this in the addressbar:
Code: Select all
::sendkeys "~<one letter here>"; //example: ::sendkeys "~k"; ::sendkeys "{Enter}Q";
Re: Command without ID to CTB?
Posted: 05 Jul 2014 18:12
by Stef123
It's like saying Do NOT think of a pink monkey, DO NOT think of a pink monkey - now you made me curious - what would it do if I entered it into the AB (which I won't

) - but what would happen?
Re: Command without ID to CTB?
Posted: 05 Jul 2014 18:27
by bdeshi
Well, how much harm can a 'ittle pink monkey do?
===
actually, it's not harmful, just alarming, and a little bit irritating. But if I let you in on the fact, you'll miss the "alarmed" emotion!!
one more thing, it will only do anything intersting if the cursor in inside the string when you press enter
(::sendkeys "~<cursor here>Z";)
The irritation has to do with the addressbar dropdown list...
Re: Command without ID to CTB?
Posted: 05 Jul 2014 19:20
by Stef123
Yep - that did indeed alarm me

- XY however fell asleep ZZZZZZZZZZZZZZZZZZ - didn't stop snoring, though - Ctrl Alt Del and good riddance.
Anyway, enough curiosity for today (glad it didn't kill the cat) - thanks again.