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 

Getting AutoHotKey to type for you

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



Joined: 15 Nov 2009
Posts: 3

PostPosted: Sun Nov 15, 2009 6:14 am    Post subject: Getting AutoHotKey to type for you Reply with quote

I've written quite abit of AutoHotKey scripts now, but I'm busy writing one to do my whole morning routine. It pretty much opens Firefox, moves mouse to position of password bar, etc. etc.
And its all working fine except for the fact that I can't get it to type out my password for me. Please help! Sad

Also, is there a way for AHK to press key commands? How?

Cheers,
NaartjieDude
Back to top
View user's profile Send private message
rtcvb32



Joined: 17 Feb 2008
Posts: 125

PostPosted: Sun Nov 15, 2009 6:29 am    Post subject: Reply with quote

read about 'send'

http://www.autohotkey.com/docs/commands/Send.htm
Back to top
View user's profile Send private message Yahoo Messenger
NaartjieDude



Joined: 15 Nov 2009
Posts: 3

PostPosted: Sun Nov 15, 2009 6:58 am    Post subject: Reply with quote

OK, this is my code so far:
Code:

sleep, 15000
Run, firefox.exe [, C:\Program Files\Mozilla Firefox, Max]
Click 79, 82
Send mypasswordhere


Aaaand it doesn't type my password.

The "Click 79, 82" is so that The input password box is selected. Except sometimes the box moves, so also is there a way to select a window? I think I read something like that....
Back to top
View user's profile Send private message
rtcvb32



Joined: 17 Feb 2008
Posts: 125

PostPosted: Sun Nov 15, 2009 7:18 am    Post subject: Reply with quote

first you aren't giving ANY time at all for firefox to open and load. Your password may be typed on another page or on the desktop for all we know.

It is possible to navigate textboxes links and other things using the tab, however you might be better off using COM controls to do that part.

http://www.autohotkey.com/forum/topic34972.html
Back to top
View user's profile Send private message Yahoo Messenger
Guest






PostPosted: Sun Nov 15, 2009 7:45 am    Post subject: Reply with quote

OK, I've changed it abit.
Code:
sleep, 200
Run, firefox.exe [, C:\Program Files\Mozilla Firefox, Max]
sleep, 3000
MouseMove, 313, 115 [,20]
Click
sleep, 5000
Click 681, 585
sleep, 5000
MsgBox, 4,, Would you like to continue to Gmail? (press Yes or No)
IfMsgBox Yes
    send {LControl}+{T}
    Click 151, 88
    sleep, 5000
    click 1236, 430
IfMsgBox No
    Click 151, 88
    sleep, 5000
    click 1236, 430
]
Now it:
Loads up Firefox, waits 3 seconds. Presses a bookmark to Facebook, waits 5 seconds. Next it presses the login button, waits 5 seconds. A window pops up, asking if you want to continue to Gmail.
If you press yes, it goes to Gmail logs in, everything correct. If you press no, its supposed to create a new tab, then go into Gmail. But it doesn't.
Back to top
Guest






PostPosted: Sun Nov 15, 2009 7:47 am    Post subject: Reply with quote

K, I've changed it abit.
Code:

sleep, 200
Run, firefox.exe [, C:\Program Files\Mozilla Firefox, Max]
sleep, 3000
MouseMove, 313, 115 [,20]
Click
sleep, 5000
Click 681, 585
sleep, 5000
MsgBox, 4,, Would you like to continue to Gmail? (press Yes or No)
IfMsgBox Yes
    send {LControl}+{T}
    Click 151, 88
    sleep, 5000
    click 1236, 430
IfMsgBox No
    Click 151, 88
    sleep, 5000
    click 1236, 430

Now it:
Loads up Firefox, waits 3 seconds. Presses a bookmark to Facebook, waits 5 seconds. Next it presses the login button, waits 5 seconds. A window pops up, asking if you want to continue to Gmail.
If you press yes, it goes to Gmail logs in, everything correct. If you press no, its supposed to create a new tab, then go
Back to top
rtcvb32



Joined: 17 Feb 2008
Posts: 125

PostPosted: Sun Nov 15, 2009 8:17 am    Post subject: Reply with quote

You should probably read up on WinWait. Also, depending on what browser, if it's maximized or not, or if you end up changing your resolution the positions will likely break later. Just a heads up.

http://www.autohotkey.com/docs/commands/WinWaitActive.htm
Back to top
View user's profile Send private message Yahoo Messenger
Guest






PostPosted: Sun Nov 15, 2009 2:55 pm    Post subject: Reply with quote

I still cant get Firefox to open a new tab. Is the syntax for this line correct?
Code:
    send {LControl}+{T}
Back to top
NaartjieDude



Joined: 15 Nov 2009
Posts: 3

PostPosted: Sun Nov 15, 2009 2:57 pm    Post subject: Reply with quote

for some reason I kept logging out each time I followed a new link, problem solved now. Razz
Back to top
View user's profile Send private message
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