Jump to content

Single Key Repeated Not Working


Recommended Posts

I must be missing something. I have had this problem multiple times. Why does F6 key not send 6 times?  

Not working 

ControlSend("[CLASS:#32770]", "", "", ("{F6 6}"))

Working

ControlSend("[CLASS:#32770]", "", "", ("{F6}"))
      ControlSend("[CLASS:#32770]", "", "", ("{F6}"))
      ControlSend("[CLASS:#32770]", "", "", ("{F6}"))
      ControlSend("[CLASS:#32770]", "", "", ("{F6}"))
      ControlSend("[CLASS:#32770]", "", "", ("{F6}"))
      ControlSend("[CLASS:#32770]", "", "", ("{F6}"))

 

You miss 100% of the shots you don't take. -Wayne Gretzky -Michael Scott

Link to comment
Share on other sites

You haven't specified a Control you want to send the key to.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

17 hours ago, SkysLastChance said:

ControlSend("[CLASS:#32770]", "", "", ("{F6 6}"))

Should work, even without a control, I tested it on notepad.  Only reason I could think is you dont have focus on the right window.

BTW parenthesis are useless.  But it is not the problem :lol:

Edited by Nine
Link to comment
Share on other sites

If you do not specify a Control, which Control gets the keys I send? The first, the active one ...?
Haven't found anything in the help file (but I'm old and blind ;) )

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

@SkysLastChance

Maybe the repetitive keys are being sent so quickly that the application cannot recognize or process them.  The default value for the SendKeyDelay is 5 ms.  You could try adjusting the delay to something a little more human-like, maybe:

Opt('SendKeyDelay', 200)            ; Default = 5 milliseconds

 

Edited by TheXman
Link to comment
Share on other sites

47 minutes ago, water said:

If you do not specify a Control, which Control gets the keys I send?

[CLASS:#32770] seems to me like message box or an input box (could be a save file box by the use of F6).  So there should be only one at a time (normally).

13 minutes ago, TheXman said:

Maybe the repetitive keys are being sent so quickly that the application cannot recognize or process them.

Not a bad idea but I trust the keys sent by controlsend are all buffered.  But worth a try.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...