Jump to content

Getting mad at ControlSend()


Recommended Posts

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.

Link to comment
Share on other sites

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}")

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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)

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

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

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...