AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

what is the code for pressing F11 and sending the Clipboard?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
drmurdoch



Joined: 10 Nov 2006
Posts: 89

PostPosted: Thu Feb 21, 2008 8:19 am    Post subject: what is the code for pressing F11 and sending the Clipboard? Reply with quote

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 9:11 am; edited 1 time in total
Back to top
View user's profile Send private message
drmurdoch



Joined: 10 Nov 2006
Posts: 89

PostPosted: Thu Feb 21, 2008 8:25 am    Post subject: Reply with quote

Press F11 = F11 (I think).
Back to top
View user's profile Send private message
drmurdoch



Joined: 10 Nov 2006
Posts: 89

PostPosted: Thu Feb 21, 2008 8:33 am    Post subject: Forgot some parts Reply with quote

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
View user's profile Send private message
drmurdoch



Joined: 10 Nov 2006
Posts: 89

PostPosted: Thu Feb 21, 2008 8:35 am    Post subject: From Titan Reply with quote

It can all be done using the commands: FileAppend, StringMid, StringReplace, Send, WinWait, ControlSend/send, EnvAdd.
Back to top
View user's profile Send private message
drmurdoch



Joined: 10 Nov 2006
Posts: 89

PostPosted: Thu Feb 21, 2008 8:39 am    Post subject: Reply with quote

;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 9:05 am; edited 3 times in total
Back to top
View user's profile Send private message
drmurdoch



Joined: 10 Nov 2006
Posts: 89

PostPosted: Thu Feb 21, 2008 8:45 am    Post subject: Reply with quote

Typical Entry
10:00 Potter, Harry 0 follow up ON 266012096 9999

0 is the zero
Back to top
View user's profile Send private message
drmurdoch



Joined: 10 Nov 2006
Posts: 89

PostPosted: Thu Feb 21, 2008 9:09 am    Post subject: Reply with quote

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 9:56 am; edited 2 times in total
Back to top
View user's profile Send private message
drmurdoch



Joined: 10 Nov 2006
Posts: 89

PostPosted: Thu Feb 21, 2008 9:55 am    Post subject: Reply with quote

seems to work but Send F11 doesn't trigger my ESP app.
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6772
Location: Pacific Northwest, US

PostPosted: Thu Feb 21, 2008 8:19 pm    Post subject: Reply with quote

you need to send the key {F11}, not the letters F 1 1.

Use
Code:

Send {F11}

_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
drmurdoch



Joined: 10 Nov 2006
Posts: 89

PostPosted: Fri Feb 22, 2008 4:44 am    Post subject: Reply with quote

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
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6772
Location: Pacific Northwest, US

PostPosted: Fri Feb 22, 2008 5:06 am    Post subject: Reply with quote

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.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
drmurdoch



Joined: 10 Nov 2006
Posts: 89

PostPosted: Fri Feb 22, 2008 5:29 am    Post subject: Reply with quote

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
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6772
Location: Pacific Northwest, US

PostPosted: Fri Feb 22, 2008 5:33 am    Post subject: Reply with quote

if you are worried about sending text reliably, try the different send modes (input, play, event, etc.) also, try messing with setkeydelay.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group