topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 5:13 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Send Keys [Solved]  (Read 6993 times)

Garfield2

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 11
    • View Profile
    • Donate to Member
Send Keys [Solved]
« on: December 27, 2017, 09:28 PM »
I am trying to understand how send keys works and would appreciate any assistance. I figure I would ask for help then waste time trying to figure it out on my own.

What I would like to do is send a shift + tab key combination followed by a copy command 4 times. This would copy 4 pieces of text. Then send Alt + Tab to activate another window and then paste into four input fields using the tab key to advance to the appropriate fields and finally hitting the enter key to send the form.

I think it is possible but the instructions seem confusing to figure this out and a search of the forum does not create any clarity by reviewing prior posts.

It seems that what I would do is create a new formatting present with these send keys but I am lost. I can probably do this easier with Arsclip but wanted to use Clipboard Help & Spell.

It would be nice to have a video on "send keys" and if I figure this out I may just create one myself.

Thank you.
« Last Edit: January 06, 2018, 01:47 PM by Garfield2 »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Send Keys
« Reply #1 on: December 28, 2017, 04:59 AM »
Hi Garfield.
The SendKeys functionality is definitely an area that only a handful of people have ever played with -- and I'm not in that handful  :P
I'd love to hear what you discover and a video would be awesome.  While I can't help much, I can promise that if you find things you can't do I can try to add features to help.
My only advice is to start simple.
The sendkey stuff is from TPushKeys and there is some code to download there if that would help you to see what functions are available.

Garfield2

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 11
    • View Profile
    • Donate to Member
Re: Send Keys
« Reply #2 on: December 28, 2017, 07:28 AM »
Thank you for your quick reply. I don't think you understand. I don't even understand where to start adding the code. If you don't understand either then okay but I just need to know where it goes.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Send Keys
« Reply #3 on: December 28, 2017, 07:36 AM »
Let me explain a little about the idea..

Normally you have a clip in your database that contains text or an image.

The special sendkeys option allows you to create a clip that sends special characters to a target window WHEN IT IS PASTED INTO THAT WINDOW.

So, as per the example in the help file, if your clip text is:
{sendkeys}1111{TAB}2222{TAB}3333

Then when you attempt to paste this clip into a target application (via the quick paste menu for example), then it will try to send the keys to the target application as if you typed 1 then 1 then 1 then 1 then tab etc..

You can also use this {sendkeys} prefix for the quick formatting preset feature.

So if we take your request:
What I would like to do is send a shift + tab key combination followed by a copy command 4 times

It would probably be a clip (or a formatting preset) that looked something like:
{sendkeys}+{TAB}^C^C^C^C

that should send shift-tab followed by four Ctrl+C (copy) keys.

I'm getting this codes from the sendkeys help page in CHS help file.

The +{TAB} is a bit unusual, youd have to test that to make sure it works.. if that doesnt work you might try +({TAB})

Garfield2

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 11
    • View Profile
    • Donate to Member
Re: Send Keys
« Reply #4 on: December 28, 2017, 07:45 AM »
Thank you. I think I understand now. It's not that Clipboard Help and Spell uses them it's that it can send it to other programs. Thank you. I thought your mention of send keys meant that this was a functionality of Clipboard Help and Spell. No wonder there were no examples of it being used in the program to control keyboard shortcuts. My intended use case is probably more suited to a clipboard program with macro like abilities which Arsclip can do.

Thanks again for the clarification.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Send Keys
« Reply #5 on: December 28, 2017, 07:57 AM »
I thought your mention of send keys meant that this was a functionality of Clipboard Help and Spell.

Hmm, well it is a functionality of CHS -- its a feature that lets CHS interpret your request to generate/simulate special keys and send them to a target window.  It does give CHS some minimal macro program facilities.

Normally CHS performs a clip paste by putting some text on the clipboard and then triggering a Ctrl+V to paste the clip into an active window.

But some programs do not support Ctrl+V for pasting, which is one situation where using {sendkeys} can be useful.

Another situation is when you are pasting into a program that is looking at each keypress individually and requires {sendkeys} in order to properly receive tabs or dashes, etc.

Garfield2

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 11
    • View Profile
    • Donate to Member
Re: Send Keys
« Reply #6 on: December 28, 2017, 12:41 PM »
Okay, now I understand. I believe this is perfect example where screenshots probably would have helped to clarify things. I literally did not know where the "send key codes" were supposed to be placed. I was expecting a send keys "window" and the closest I could get to figuring this out was thinking it should be put inside a formatting preset. Now I understand the concept that the program will not just paste the send key code but actually interpret them as keyboard shortcuts. It is was very difficult without an example video or screenshot for me to figure this out. Now I will have to play around with it and do some tests. I tried using the formatting preset and when I tried to type I got ding sounds so there was something I was not doing right.

Thank you again for the clarification. I don't mind playing with the send keys. Auto hotkey uses a similar set up but just had no idea where in Clipboard Help + Spell it should be added/inserted.  :up:

I now see my 2 options are formatting preset or in an actual clip. I just had to reread your reply a couple of times to figure it out and it seems to me this is an underutilized part of the program given my search of the discussion group and help content.

I will make a video once I get my desired result.  :up:

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Send Keys
« Reply #7 on: December 28, 2017, 12:47 PM »
Yes. My suggestion is to start by creating a new clip in your Favorites folder, and just try something like:  {sendkeys}123{TAB}456.
And then go into notepad and use the quick paste hotkey to paste this clip and watch how it pastes and make sure it works as expected.

Garfield2

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 11
    • View Profile
    • Donate to Member
Re: Send Keys
« Reply #8 on: December 30, 2017, 08:02 AM »
Just wanted to say thank you for your attentive responses and just providing an update in lieu of a final solution. I'm the kind of person who won't let go until I find a solution so I will report when I do.

My current "almost there" solution is to use autohotkey to make a web browser window active and then use it to send the keys that I need to copy 4 pieces of text and then make another window active. Clipboard Help + Spell captures all the text. 1,2,3,4. No problem. The next window has 4 input fields I want to target. Auto Hotkey sends the keyboard combination of Control + Alt + Q just fine and brings up CHS however when I try to select a clip (using a number right Control + Alt + Q ) it goes directly to the 2nd web page sometimes adding the number one into the input box.

So my next milestone is to get auto hotkey to select a clip using the keyboard. For some reason after bringing up the CHS window it just seems to stop sending instructions to the window that is clearly still displayed on the screen.

No need to reply unless I am missing something really simple and you feel compelled to. I am working in Auto Hotkey land now. It seems this form filling thing is not as easy to figure out using CHS solely but I want to use CHS and am okay getting another script to help out.

I did  do a small test as you had mentioned and that worked but for me but this seems a little impractical. It is not dynamic to use text that does not come from CHS like 1111 or 2222. I don't mind using send keys if I can actually reference clips within CHS that I copy in the moment and want to paste in another situation so it can automate repetitive data entry. The referencing of existing clips from the documentation doesn't seem to be something that is made known. Figuring out how to correctly use the stack process may help so I will examine that as well.
« Last Edit: December 30, 2017, 08:11 AM by Garfield2 »

Garfield2

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 11
    • View Profile
    • Donate to Member
Re: Send Keys
« Reply #9 on: December 30, 2017, 08:25 AM »
Update: After watching the video again got stacking to work but my goal is to start from the last copied clip and go down 1, 2, 3, 4 and not backwards. I could come up with a workaround but would like to reverse the order of the stack.

Still need to get Auto Hotkey to communicate with the Pop up menu.   

Garfield2

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 11
    • View Profile
    • Donate to Member
Re: Send Keys
« Reply #10 on: December 30, 2017, 12:58 PM »
Update: Got it done. Minimally using Auto Hotkey and Clipboard Help + Spell. Didn't use stack options. Used Auto Hotkey to send the Keyboard Keys and Used Clipboard Help + Spell for storing the text. Need to put in a few tweaks want to clean up the text a bit. Will work on a video soon.  :Thmbsup:

Garfield2

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 11
    • View Profile
    • Donate to Member
Re: Send Keys
« Reply #11 on: December 31, 2017, 05:11 AM »
Automated Tagging System via Auto Hotkey with an assist from CHS

Background:
: Life is easy. Tagging is hard. I run a site where I would like to tag my videos. Getting volunteer help to assist you with this I feel is like asking someone to search imdb manually to find the right info and making it more apparent that their life is ending 1 minute at a time.

Goal: To automate tagging as much as possible so I take as few minutes of their lives as possible.

Intended Methods:
  • Don't reinvent the wheel. Ethically hack another web site's already existing tagging system (work smart not hard):
    • Use Stylish browser addon to isolate relevant tag drop downs
    • These drop downs have auto complete and allow you to select tags without adding them to an input field or even submitting the form
  • Copy tags from this web site and add them to your Google sheet specifically for each video. Rinse & repeat.
    • Customize your own video detail page for each video using VBA (approx 1,100 html pages)
    • Strip the traditional Google form of all non essentials and embed form on page (all tagging info in a spreadsheet)


What I learned
: CHS could not do what I wanted when it came to automating Keyboard navigation with my limited knowledge of send keys. Primarily, I don't think I knew enough to switch between the 2 web pages using "send keys". Also CHS has great formatting presets but those triggered new clips that messed up my order for pasting "clip sets". (copying text from last to first and paste from first to last for each tagging session). These are not necessarily limitations of CHS but I just knew how to figure this out with Auto Hotkey faster then with Sendkeys. Also couldn't figure out how to trigger a stack starting from 1 and going to 4.  This is why I said "with an assist from CHS" because CHS is just managing the clipboard history. AHK is doing all the automation heavy lifting.

Also I used Windows Key + q to launch CHS in Auto Hotkey and used Tab to select the clips ie tab once for clip 1 and tab twice for clip 2 and so on.

Thank you mouser for your encouragement by responding to my post. If you see any obvious things I overlooked feel free to chime in. I won't eat you. Apparently I like Lasagna  :D.
« Last Edit: January 04, 2018, 05:06 PM by Garfield2 »