| View previous topic :: View next topic |
| Author |
Message |
drmurdoch
Joined: 10 Nov 2006 Posts: 110
|
Posted: Thu Feb 21, 2008 7:19 am Post subject: what is the code for pressing F11 and sending the Clipboard? |
|
|
Idea:
I will highlight my next client's name from my scheduling program.
I would like to find all their files by executing a program I use called ESP. I would like to find their files based on their first and last name.
Typical Data
| Code: |
Lastname, Firstname 0 pension funds down ON number version clientnumber |
#Persistent
^,::
^c
delay = 100
"Press F11"
delay = 500
Send "the clipboard"
Send {Enter}
Return
Last edited by drmurdoch on Thu Feb 21, 2008 8:11 am; edited 1 time in total |
|
| Back to top |
|
 |
drmurdoch
Joined: 10 Nov 2006 Posts: 110
|
Posted: Thu Feb 21, 2008 7:25 am Post subject: |
|
|
| Press F11 = F11 (I think). |
|
| Back to top |
|
 |
drmurdoch
Joined: 10 Nov 2006 Posts: 110
|
Posted: Thu Feb 21, 2008 7:33 am Post subject: Forgot some parts |
|
|
from my older post-
| Code: | Copy everything to clipboard (before the script)
Press control+F11 to execute the script
Save the Clipboard.
Find the first charcter that is the number 0, then copy everything before the number 0 (not including)
strip out any commas.
F11 key
Wait for application.
"Type" (not paste) the string into the application (ie. not just paste).
Return to the initial clipboard + add date (format - Jan 28, 2008) to the end. |
|
|
| Back to top |
|
 |
drmurdoch
Joined: 10 Nov 2006 Posts: 110
|
Posted: Thu Feb 21, 2008 7:35 am Post subject: From Titan |
|
|
| It can all be done using the commands: FileAppend, StringMid, StringReplace, Send, WinWait, ControlSend/send, EnvAdd. |
|
| Back to top |
|
 |
drmurdoch
Joined: 10 Nov 2006 Posts: 110
|
Posted: Thu Feb 21, 2008 7:39 am Post subject: |
|
|
;Press control+F11 to execute the script (key text is highlighted).
^F11::
;Copy everything to clipboard
^c
;Save the Clipboard as a variable
ClipSaved := ClipboardAll
;Find the first charcter that is the number 0, then copy everything before the number 0 (not including)
Needle = 0
StringGetPos, pos, ClipboardAll, %Needle%
if pos >= 0
MsgBox, FYI, The string was found at position %pos%.
StringLeft, PersonName, ClipboardAll, pos
;strip out any commas.
;not required.
;F11 key
F11
;Wait for application.
delay = 600
;"Type" (not paste) the string into the application (ie. not just paste).
Send PersonName
;Return to the initial clipboard + append date (format - Jan 28, 2008) to the end.
Clipboard := ClipSaved + "the date"
Last edited by drmurdoch on Thu Feb 21, 2008 8:05 am; edited 3 times in total |
|
| Back to top |
|
 |
drmurdoch
Joined: 10 Nov 2006 Posts: 110
|
Posted: Thu Feb 21, 2008 7:45 am Post subject: |
|
|
Typical Entry
10:00 Potter, Harry 0 follow up ON 266012096 9999
0 is the zero |
|
| Back to top |
|
 |
drmurdoch
Joined: 10 Nov 2006 Posts: 110
|
Posted: Thu Feb 21, 2008 8:09 am Post subject: |
|
|
| Code: | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
#Persistent
^F11:: ;Press control+F11 to execute the script (key text is highlighted).
Send ^c ;Copy everything to clipboard
clipboard = %clipboard%
ClipSavage := clipboard ;Save the Clipboard as a variable ClipSavage.
MsgBox, FYI, The string was found whatever %clipboard%
delay = 9000
;Find the first charcter that is the number 0, then copy everything before the number 0 (not including)
Needle = 0
StringGetPos, pos, clipboard, 0
if pos >= 0
MsgBox, FYI, The string was found at position %pos%.
StringLeft, PersonName, clipboard, pos ; Assign everything before the 0 to PersonName.
;strip out any commas. ;not required.
Send F11 ;F11 key
delay = 600 ;Wait for application.
Send PersonName ;"Type" (not paste) the string into the application (ie. not just paste).
Clipboard := ClipSaved
Return |
Last edited by drmurdoch on Thu Feb 21, 2008 8:56 am; edited 2 times in total |
|
| Back to top |
|
 |
drmurdoch
Joined: 10 Nov 2006 Posts: 110
|
Posted: Thu Feb 21, 2008 8:55 am Post subject: |
|
|
| seems to work but Send F11 doesn't trigger my ESP app. |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 8255 Location: Maywood, IL
|
Posted: Thu Feb 21, 2008 7:19 pm Post subject: |
|
|
you need to send the key {F11}, not the letters F 1 1.
Use
_________________
(Common Answers) |
|
| Back to top |
|
 |
drmurdoch
Joined: 10 Nov 2006 Posts: 110
|
Posted: Fri Feb 22, 2008 3:44 am Post subject: |
|
|
Send {F11} ;F11 key
delay = 600 ;Wait for application.
Send %PersonName% ;"Type" (not paste) the string into the application (ie. not just paste).
Clipboard := ClipSaved
Return
-- almost working.
It is unreliable for unknown reasons.
Must be a focus issue. |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 8255 Location: Maywood, IL
|
Posted: Fri Feb 22, 2008 4:06 am Post subject: |
|
|
perhaps you can use some other way to wait for the application instead of a delay? are you waiting for a certain window to pop up? See WinWait, WinActivate, and WinWaitActive commands. _________________
(Common Answers) |
|
| Back to top |
|
 |
drmurdoch
Joined: 10 Nov 2006 Posts: 110
|
Posted: Fri Feb 22, 2008 4:29 am Post subject: |
|
|
i am waiting for a screen.
I think it popups up unmaximized sometimes.
or the on screen control + F11 sticks.
annoying.
maybe I am not sending the text reliably.
It is a unique program in that you press F11 and start typing it sort of does not require focus. |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 8255 Location: Maywood, IL
|
Posted: Fri Feb 22, 2008 4:33 am Post subject: |
|
|
if you are worried about sending text reliably, try the different send modes (input, play, event, etc.) also, try messing with setkeydelay. _________________
(Common Answers) |
|
| Back to top |
|
 |
drmurdoch
Joined: 10 Nov 2006 Posts: 110
|
Posted: Tue Jan 20, 2009 5:52 pm Post subject: |
|
|
I am a bit lost about getting this script to work.
SendInput %PersonName%
is unreliable (sometime it only will get one letter in the box I want it in).
and I can't seem to get the other options to work.
Any more tips ? |
|
| Back to top |
|
 |
drmurdoch
Joined: 10 Nov 2006 Posts: 110
|
Posted: Sun Feb 08, 2009 3:09 am Post subject: |
|
|
It copies it to the clipboard but often the paste doesn't work well, like it will only paste the first letter of the string.
 |
|
| Back to top |
|
 |
|