AutoHotkey Community

It is currently May 26th, 2012, 11:16 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: November 15th, 2009, 7:14 am 
Offline

Joined: November 15th, 2009, 7:09 am
Posts: 8
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! :(

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

Cheers,
NaartjieDude


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 15th, 2009, 7:29 am 
Offline

Joined: February 17th, 2008, 7:09 am
Posts: 536
read about 'send'

http://www.autohotkey.com/docs/commands/Send.htm


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 15th, 2009, 7:58 am 
Offline

Joined: November 15th, 2009, 7:09 am
Posts: 8
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....


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 15th, 2009, 8:18 am 
Offline

Joined: February 17th, 2008, 7:09 am
Posts: 536
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 15th, 2009, 8:45 am 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 15th, 2009, 8:47 am 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 15th, 2009, 9:17 am 
Offline

Joined: February 17th, 2008, 7:09 am
Posts: 536
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 ... Active.htm


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 15th, 2009, 3:55 pm 
I still cant get Firefox to open a new tab. Is the syntax for this line correct?
Code:
    send {LControl}+{T}


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 15th, 2009, 3:57 pm 
Offline

Joined: November 15th, 2009, 7:09 am
Posts: 8
for some reason I kept logging out each time I followed a new link, problem solved now. :P


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Cerberus, Google Feedfetcher, JSLover, Maestr0, rbrtryn, Tipsy3000 and 63 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group