This App is No Longer Maintained. Visit the Replacement at StrokesPlus.net

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General Discussion
 General Discussion
 Copy selected text with context menu (acSendKeys)
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Mech

3 Posts

Posted - 01/20/2020 :  15:17:30  Show Profile
After making a script to copy several filled form fields from a pdf-document in Adobe Reader DC, I figured out using the context menu/right mouse button key was more reliable and faster then simply sending the default Ctrl+C (or Ctrl+Ins) key stroke.

So acSendKeys("{DELAY=50}{APP}c") turned out to be more effective than acSendKeys("{DELAY=330}^c"). For some strange (application specific) reason using Ctrl+C with a delay below 300 often didn't copy the selected text to clipboard as expected. Also tried many variations of/with acDelays before, but in the end only the 'context menu + copy' solution worked.

nober

29 Posts

Posted - 01/22/2020 :  04:48:34  Show Profile
It may have to do with the application that is handling keyboard input, perhaps some Adobe codes are in play when form fields are selected, the way application communicates with clipboard, or a combination thereof.

By the way, I would recommend using
acDelay()
over
{delay=
inside acSendKeys(), because the latter changes delay between keys not only in the calling function (in this case, control and c), but also subsequent acSendKeys(), even after restarting StrokesPlus.

Edited by - nober on 01/22/2020 08:37:27
Go to Top of Page

Hard.Wired

84 Posts

Posted - 01/22/2020 :  22:14:55  Show Profile
What is "{APP}"?
Go to Top of Page

nober

29 Posts

Posted - 01/23/2020 :  04:11:19  Show Profile
probably a typo for {apps} key
Go to Top of Page

Mech

3 Posts

Posted - 01/23/2020 :  12:11:18  Show Profile
Oddly enough even "{ap}" is working (for me). Can someone confirm this?
Go to Top of Page

Rob

USA
2615 Posts

Posted - 01/23/2020 :  12:35:56  Show Profile  Visit Rob's Homepage
Looking at the code, which I haven't for a LONG time and was originally written in Delphi in 1995(!) then converted by someone else in 2004, it compares the string to a list of key names, but it only compares based on the length of the string passed in, so {ap}, {app}, {apps} would all match since:

//KeyNames[Middle].keyName - "APPS"
LPCTSTR KeyString; //"ap"
_tcsnicmp(KeyNames[Middle].keyName, KeyString, _tcslen(KeyString)) == 0

It's only comparing the first two letters, the length of "ap"
Go to Top of Page

nober

29 Posts

Posted - 01/23/2020 :  12:50:06  Show Profile
Confirmed, upon further playing around, {a} would result in "@", {pgd} would result in "Page Down", etc., as long as first half of the key code is inside curly braces, perhaps due to the underlying code that "Implements a simple binary search to locate special key name strings" https://www.codeproject.com/script/Articles/ViewDownloads.aspx?aid=6819
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000