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 

Need help with script

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



Joined: 08 Aug 2005
Posts: 7

PostPosted: Mon Aug 08, 2005 2:34 am    Post subject: Need help with script Reply with quote

I want to write a script that, after pressing a hotkey, will launch about 5 different programs on my work computer. Not only that, but I would like the script to input my username and password and then click the appropriate login button for each program. Is this possible?

I've tried using the AutoScript Writer on my home computer as a test by launching Outlook, then Excel then entering data in a couple of cells, then launching another program. I wanted #q as my hotkey. But I keep getting the same error when I double-click the script file. It says:

Error: Requires at least one of its window parameters

Line#
001: Return
--> 002: Winwait,

Here's what the AutoScript recorded:
Code:

#q::
WinWait, ,
IfWinNotActive, , , WinActivate, ,
WinWaitActive, ,
MouseClick, left,  25,  16
Sleep, 100
WinWait, Inbox - Microsoft Outlook,
IfWinNotActive, Inbox - Microsoft Outlook, , WinActivate, Inbox - Microsoft Outlook,
WinWaitActive, Inbox - Microsoft Outlook,
MouseClick, left,  969,  14
Sleep, 100
WinWait, ,
IfWinNotActive, , , WinActivate, ,
WinWaitActive, ,
MouseClick, left,  46,  8
Sleep, 100
WinWait, Start Menu,
IfWinNotActive, Start Menu, , WinActivate, Start Menu,
WinWaitActive, Start Menu,
MouseClick, left,  377,  321
Sleep, 100
WinWait, Rhapsody,
IfWinNotActive, Rhapsody, , WinActivate, Rhapsody,
WinWaitActive, Rhapsody,
MouseClick, left,  981,  16
Sleep, 100
MouseClick, left,  968,  17
Sleep, 100
WinWait, ,
IfWinNotActive, , , WinActivate, ,
WinWaitActive, ,
MouseClick, left,  16,  23
Sleep, 100
WinWait, Microsoft Excel - Book1,
IfWinNotActive, Microsoft Excel - Book1, , WinActivate, Microsoft Excel - Book1,
WinWaitActive, Microsoft Excel - Book1,
MouseClick, left,  376,  324
Sleep, 100
Send, 123
MouseClick, left,  399,  341
Sleep, 100
Send, afdjl{ENTER}
MouseClick, left,  965,  8
Sleep, 100
return

What am I missing??


Last edited by shotokan on Mon Aug 08, 2005 12:13 pm; edited 1 time in total
Back to top
View user's profile Send private message
toralf



Joined: 31 Jan 2005
Posts: 3841
Location: Bremen, Germany

PostPosted: Mon Aug 08, 2005 4:33 am    Post subject: Reply with quote

Hi shotokan,

1) Yes it is possible.

2) It would be nice if you would put your code into [ code] [ /code] marks. That ill improve the readability. Please use the edit button in the upper right corner of your post and then the buttons above the edit field to mark it. Thanks.

3) Another request: Please use specific names as a topic name/title. When you post in the "ask for help" section, there is no need to name your topic "Another noob needs help". Please be more specific on what you need help. Thanks

4) The problem with the script is, that somehow the needed parameters for the commands are missing. Please have a look at the manual for all of them. E.g. WinActive doesn't know which window to activate. It seams that you started the program from a window without title. Now if you start the script AHK doesn't know of the active windows to start. AHK (also)needs specific details what to do.

5) It is not very robust to use mouseclicks if you want to automate things, since the coordinates may change. Please try to use keyboard shortcuts. They are more robust.

6) If you want to start a program, please look at the command "Run".

7) I advice you to use an editor to write the script. The scripts created with the recorder are limited, or as you can see in your case even not working.

8) I recommend that you read the manual.
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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