New Plugin: ClipTricks - Page 2 - Forum

Forum Navigation
You need to log in to create posts and topics.

New Plugin: ClipTricks

PreviousPage 2 of 3Next

PS I have NO clue what I'm doing to post in two font sizes...

Whenever you paste copied content try using Ctrl-Shift-V instead of Ctrl-V  :)

rcohen has reacted to this post.
rcohen

Great job on the Cliptricks plugin. This is one that everybody should have in their toolbox. Priced right and simple to use. Congrats Saeem!

rcohen has reacted to this post.
rcohen

Thanks for the good word @wrangler.   Zaeem did a great job with it for sure.  I'm already putting it to work ;-)

And thanks for your support.  It's greatly appreciated.

@Vadim,

If I can bother you once again.   Excuse my ignorance with things like window handles and ID's.   But I'm trying to use the WinHandle (which I can get easily with the setup you offered) and use it to address the window in a sendkeys command.

I use this to get the title...

zmGetForegroundWindow "[TopWin]"
zmGetWindowTitle "[TopWin]" "" "[TitleNew]"
If "[TitleNew]" "<>" "[TitleOld]"
SetVar "[Title]" "[TitleNew]"
SetVar "[TitleOld]" "[TitleNew]"
EndIF

I added the following to get the winhandle

zmGetWindowHandle "[Title]" "[WinHand]"

and then I try to address the window using

:Paste
SendKeys "[WinHand]" "{CtrlDn}V{CtrlUp}"
Return

That is a subroutine because I use NeoBookKB plugin to set a global hotkey to trigger it.

I get an error "can't find window" or some such.   So I believe it's not the window handle that sendkeys needs?

Thank you in advance for some clarification.

 

 

I would like to thank Peter Pavlov for his amazing plugin.  How did I miss this one?  Does he have a web site?  I'd like to thank him personally.

Vadim has reacted to this post.
Vadim

@rcohen

So I believe it's not the window handle that sendkeys needs?

No. This command needs an application ID .

Perform the action:

Run "[WindowsDir]notepad.exe" "" "Normal" "" "[ID]"

And look up the [ID] variable in the debugger.

This is the variable to be sent to the SendKeys command.

Run "[WindowsDir]notepad.exe" "" "Normal" "" "[ID]"
SendKeys "[ID]" "{CtrlDn}V{CtrlUp}"

Another thing to keep in mind is that if you have a keyboard layout that is NOT English, the keyboard shortcuts will not be correct. And most importantly, for example in this case, the {CtrlDn} key stays pressed when the application crashes. (if that happens).

Vadim has reacted to this post.
Vadim

@rcohen

I would like to thank Peter Pavlov for his amazing plugin.  How did I miss this one?  Does he have a web site?  I'd like to thank him personally.

For all we know, he's dead.

 

Yes, unfortunately...

 

Another thing to keep in mind is that if you have a keyboard layout that is NOT English,

For such situations Peter has written another plugin - zmKeyboard, which can detect and change the current keyboard layout. For our systems, with the Russian language, we have to execute such code:

Run "[WindowsDir]notepad.exe" "" "Normal" "" "[ID]"
zmKB_GetLayout "[Result]"
If "[Result]" "<>" "2"
zmKB_ChangeLayout "2"
EndIf
SendKeys "[ID]" "{CtrlDn}V{CtrlUp}"
zmKB_ChangeLayout "[Result]"

 

Performing the action:

zmKB_ChangeLayout "[Result]"

Returns the keyboard layout back.

But I do not know how it will work on other systems, such as Spain, France, etc., as the plugin is defined only Russian and English keyboard layout.

 

I'm attaching the zmKeyboard plugin just in case.

 

Uploaded files:
  • You need to login to have access to uploads.
Vadim has reacted to this post.
Vadim

@rcohen

Does he have a web site?

And the site is and still is:

http://neobooker.ru/

There you can also find a lot of answers to your questions.

 

luishp and rcohen have reacted to this post.
luishprcohen

The above is not the correct code for the zmKeyboard plugin. Haven't used it in a while. The correct way is this:

 

Run "[WindowsDir]notepad.exe" "" "Normal" "" "[ID]"
zmKB_GetLayout "[Result]"
If "[Result]" "=" "Rus"
zmKB_ChangeLayout "2"
EndIf
SendKeys "[ID]" "{CtrlDn}V{CtrlUp}"
If "[Result]" "=" "Rus"
zmKB_ChangeLayout "1"
EndIf

luishp, Vadim and rcohen have reacted to this post.
luishpVadimrcohen

@mishem,

Thank you for all the hard work getting me this info and code.

I won't be engaging the run for the software we need to paste into, thus the need to detect which window is active.

How does one get the correct ID of the window so that I can sendkeys?    I'm guessing there is a function for that but I am not sure even what the correct info is called.  What is the application ID and how can I retrieve it?  I see I can use "application name" also but if there are three windows of notepad open, I need to be sure I'm pointed to the right one ;-)

And for the country code thing, I appreciate that info as well, but my demographic is strictly the US.   I have stored the plugin (thank  you) and the scripting (the correct one <grin>) here with the plugin.

Thanks again @mishem, much appreciated.

Somehow I posted the above before ready to send... and I can't edit nor delete it...    Luis, can you delete it ;-)

@rcohen

Plugins:

zmFunctions

hpwSendKeys

It's a rush job, there could be mistakes.

Hope that helped. :)

 

Uploaded files:
  • You need to login to have access to uploads.

@mishem, thanks a bunch...   I'll check it out.

I think however if I can figure out what the native send keys is looking for, that I can use that... but I have no clue how to get the "Application ID" (I don't even know what that is apparently, as I was thinking it was the WinHandle).

Thanks again @mishem.  I appreciate the time you're taking with this ;-)

r

You'd have to be more specific about what you want to do. Or maybe you're going in the wrong direction?

@rcohen

Interesting translation. :) That's not what I meant at all. But I hope you know what I mean. What exactly do you want to do? We need more information.

@mishem,  I apparently confused threads...  as per the OTHER thread that asks which thread ;-)

I have set up global hotkeys for some functions that I want to paste into the software the user is already in (and have called the keyboard shortcut from).  Instead the pub gets the focus when engaging the shortcut and I have no way of pasting it right back, programmatically.   But as mentioned this was just to save the user from having to do a manual paste.   Not very important, so I'll just not add this feature ;-0

 

@rcohen

I have set up global hotkeys for some functions

 

 

Before assigning global keys, you should make sure that they are not used anywhere in the system. Otherwise, it's a mess.

 

@rcohen

Below is an example on how to check the hotkeys.

Before you try to change something on someone else's computer, check 10 times to see if you are doing any damage. ;)

Uploaded files:
  • You need to login to have access to uploads.
Vadim and rcohen have reacted to this post.
Vadimrcohen

You are absolutely correct @mishem, which is why I changed direction.  I now use two hotkeys.  I did some googling about unused hotkeys and without knowing what the user has installed that's not really possible.  I will put this pub in my collection as one day I might again need it.    Thanks for that.   Do you have any of your work online?  You seem to be a very strong coder, so I'm guessing you have software to sell ?

Thanks again.

PreviousPage 2 of 3Next