Jump to content
Sign in to follow this  
bootybay

Getting mad at ControlSend()

Recommended Posts

bootybay

So I basically just want to automate a quick website login.

I know I can use Send() and it works fine but I want to be able to use ControlSend() for this.

There is one specific special character that is giving me trouble. The good old @.

I just can't controlsend this. It doesnt matter if I use the raw(1) or default(0) flag.

 

For special characters like "!" I can just workaround and use "+1"  = (Shift +1) instead.

But for "@" I can't use "^!q" = (CTRL+ALT+q). (I got a german keyboard, the english "+2" = (Shift  +2) is not working)

Examples:

ControlSend($hwnd, "", "", "mail@box.com", 0) -> "mailqbox.com"
ControlSend($hwnd, "", "", "mail@box.com", 1) -> "mailqbox.com"
ControlSend($hwnd, "", "", "mail^!qbox.com", 0) -> "mailqbox.com"
ControlSend($hwnd, "", "", "mail^!qbox.com", 1) -> "mail^!qbox.com"

I hope someone can help me out. This is driving me insane.

Share this post


Link to post
Share on other sites
junkew

Send the ASCII value for @

quoted from help in Send command (ControlSend is similar)

To send the ASCII value A (same as pressing ALT+065 on the numeric keypad)
    Send("{ASC 065}")

(When using 2 digit ASCII codes you must use a leading 0, otherwise an obsolete 437 code page is used).

To send UNICODE characters enter the character code (decimal or hex), for example this sends a Chinese character
    Send("{ASC 2709}") or Send("{ASC 0xA95}")

 

Share this post


Link to post
Share on other sites
Bearpocalypse

I've had issues with ControlSend. Try using ControlCommand.

Share this post


Link to post
Share on other sites
Exit

It would be helpful, if you give us the URL of the login page.

And a reproducer script.

Edited by Exit

My UDFs, Abbrevs and Snippets
If you like my post, just click the like button :) 

Share this post


Link to post
Share on other sites
bootybay

There are differences between Send() and ControlSend().

The biggest difference is that you can't use stuff like holding keys down {a down} and using more then one modifier doesn't seem to work too.

@Exit: It doesn't matter. Using it on the chrome omnibar gives the same results as on any webpage.

 

@junkew: {ASC 064} works. Thanks man! ControlSend($hwnd, "", "", "mail{ASC 064}box.com", 0) -> "mail@box.com"

 

EDIT: NVM it doesn't work on twitter. Cool stuff. ControlSend($hwnd, "", "", "mail{ASC 064}box.com", 0) -> "mailqbox.com"

But atleast it does on Facebook...

EDIT2: Now it works sometimes. And Sometimes it doesnt. I'm done with this shit.

Edited by bootybay

Share this post


Link to post
Share on other sites
Exit

If HotKeySet("{ESC}", "_ESC") = 0 Then Exit MsgBox(16 + 262144, "Hotkeyset Error", "Hotkey {ESC} already set.")
Run("Notepad")
$hwnd = (WinWait("[Class:Notepad]", "", 0) ? (WinActivate("[LAST]") ? WinWaitActive("[LAST]") : 0) : SetError(1, 0, 0))
ControlSend($hwnd, "", "", "mail^!qbox.com", 0)
Beep(1500, 100)
Sleep(5000)
_ESC()

Func _ESC()
    Exit WinKill($hwnd) + Beep(1000, 100)
EndFunc   ;==>_ESC

Works only for German keyboard   (Strg+Alt+q)


My UDFs, Abbrevs and Snippets
If you like my post, just click the like button :) 

Share this post


Link to post
Share on other sites
junkew

This works fine 

ControlSend($hwnd, "", "", "mail{ASC 0x0040}qbox.com", 0)
alternative (could be that keyboard / system just needs some processing time)

ControlSend($hwnd, "", "", "mail", 0)
sleep(250)
ControlSend($hwnd, "", "", "{ASC 0x0040}", 0)
sleep(250)
ControlSend($hwnd, "", "", "qbox.com", 0)
if really not stable use ie.au3, ff.au3, chrome.au3 or see this thread

'?do=embed' frameborder='0' data-embedContent>>

 

more complicated to just set a value but there are methods in above 4 libraries to set a value of an HTML textbox

Share this post


Link to post
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
Sign in to follow this  

  • Similar Content

    • grimmlock
      By grimmlock
      Hey everyone
      I want to be able to press a button within a application however so far what I have tried does not seem to be working. I have successfully made the application (window) active, but when I try:

          WinActivate("- AdwCleaner - v4.109")     WinWaitActive("- AdwCleaner - v4.109")     send("{Tab}{Space}") ; even ("{TAB}{SPACE}")  

          WinActivate("- AdwCleaner - v4.109")     WinWaitActive("- AdwCleaner - v4.109")     ControlSend("- AdwCleaner - v4.109", "", "[CLASSNN:Button3]", "{SPACE}")  

          WinActivate("- AdwCleaner - v4.109")     WinWaitActive("- AdwCleaner - v4.109")     ControlClick("- AdwCleaner - v4.109", "Scan", "[CLASS:Button;INSTANCE:3]")  
      I have tried using the finder utility and that is how I got the Class and instance number but nothing is working. Could someone help?
      Thanks
      Grimm

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.