Sending Strings with HoldKey
Moderators: JRL, Dorian (MJT support)
-
- Macro Veteran
- Posts: 260
- Joined: Fri Apr 15, 2005 8:32 am
Sending Strings with HoldKey
Any way to send strings using HoldKey? I'd like to send a string without parsing each character. (An app I'm using only accepts HoldKey input, i.e. not Send, VBScript, etc.) Thanks!
Re: Sending Strings with HoldKey
How about these two options?
1.
OR
2.
As seen in the script below- both works with Notepad
1.
Code: Select all
UISetValue>{"Untitled - Notepad"},{"Text Editor"},{%Str%}
2.
Code: Select all
HoldKey>Str,500,0
Code: Select all
LabeltoVar>String,Str
SetFocus>Notepad*
WaitWindowFocused>Notepad*
//UISetValue>{"Untitled - Notepad"},{"Text Editor"},{%Str%}
HoldKey>Str,500,0
/*
String:
const btn = document.createElement("button");
const object1 = document.querySelectorAll(":hover").item(9);
const htm1 = object1.outerHTML;
btn.innerHTML = htm1;
document.body.appendChild(btn);
*/
-
- Macro Veteran
- Posts: 260
- Joined: Fri Apr 15, 2005 8:32 am
Re: Sending Strings with HoldKey
Thanks for showing me the UI commands. Hadn't seen those before that I remember.
Hmmm.... That script does nothing for me except to focus the Notepad window. If I remove the "//" comment from the UISetValue> line, then it enters into Notepad the text in Str.
Sadly, UISetValue> does not work with this app. Thanks though!
For now I'm using this:
Hmmm.... That script does nothing for me except to focus the Notepad window. If I remove the "//" comment from the UISetValue> line, then it enters into Notepad the text in Str.
Sadly, UISetValue> does not work with this app. Thanks though!
For now I'm using this:
Code: Select all
Let>GW=0.1
GoSub>HoldKeyStr,AnyText
SRT>HoldKeyStr
//Send a string one character at a time using HoldKey.
Let>Str=HoldKeyStr_Var_1
Length>Str,StrLen
Let>kStr=0
Repeat>kStr
Add>kStr,1
MidStr>Str,kStr,1,HoldKeyChar
HoldKey>HoldKeyChar,1,0
Wait>GW
Until>kStr,StrLen
END>HoldKeyStr
Re: Sending Strings with HoldKey
Hi fightcancer,
Please try using the "Send Keys to Objects Wizard" under Keyboard Commands:
Please try using the "Send Keys to Objects Wizard" under Keyboard Commands:
Code: Select all
//Send keystrokes directly to Notepad's edit control (Notepad does not require focus)
GetWindowHandle>Untitled - Notepad,hWndParent
FindObject>hWndParent,Edit,,1,hWnd,X1,Y1,X2,Y2,result
ObjectSendKeys>hWnd,{"Hello World"}
-
- Macro Veteran
- Posts: 260
- Joined: Fri Apr 15, 2005 8:32 am
Re: Sending Strings with HoldKey
Yes, I can automate Notepad, but the goal is to automate another app I'm using, an app that doesn't have objects discernible to MS besides Minimize, Maximize and Close.
I have a functional solution for now. Thanks!
I have a functional solution for now. Thanks!