Command without ID to CTB?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Stef123

Command without ID to CTB?

Post 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?

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Command without ID to CTB?

Post by bdeshi »

Assuming you use XYplorer in English,

Code: Select all

::sendkeys "{f9}mff%n";
:ugeek:
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Stef123

Re: Command without ID to CTB?

Post 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?

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Command without ID to CTB?

Post 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."
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Stef123

Re: Command without ID to CTB?

Post by Stef123 »

And once again I have to ask you: Where on earth do you find all this stuff, Sammay? :shock:
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?

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Command without ID to CTB?

Post by bdeshi »

Okay, try this then:

Code: Select all

sendkeys "^kmff%n";
====
"Where on earth do you find all this stuff, Sammay? :shock: "
:D*

"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...
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Stef123

Re: Command without ID to CTB?

Post by Stef123 »

SammaySarkar wrote:That's the reason we have to start with a unique item: with the M.
:eh: :arrow: :idea: 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?

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Command without ID to CTB?

Post 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] :whistle:
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: Command without ID to CTB?

Post 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?
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Command without ID to CTB?

Post by bdeshi »

Almost, but no, I remember there was a all-english post too...
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Stef123

Re: Command without ID to CTB?

Post 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?

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Command without ID to CTB?

Post 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";
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Stef123

Re: Command without ID to CTB?

Post 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 :naughty: ) - but what would happen?

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Command without ID to CTB?

Post by bdeshi »

Well, how much harm can a 'ittle pink monkey do? :wink:
===
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!! :twisted:
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...
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Stef123

Re: Command without ID to CTB?

Post by Stef123 »

Yep - that did indeed alarm me :shock: - 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.

Post Reply