f901 Posted July 2, 2007 Share Posted July 2, 2007 I'm sorry if this has been asked before, I did search but all I could find were macros alot more complex than what I am capable of understanding and need. Basically I need to be able to run my macro once when I hit a hotkey. This is my macro, I need to be able to run this macro once when I hit a key on the keyboard.Thanks in advance, CODEOpt("WinWaitDelay",100) Opt("WinTitleMatchMode",4) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) WinWait("Welcome to Rediffmail: - Opera","") If Not WinActive("Welcome to Rediffmail: - Opera","") Then WinActivate("Welcome to Rediffmail: - Opera","") WinWaitActive("Welcome to Rediffmail: - Opera","") Send("{ALTDOWN}{TAB}{ALTUP}") WinWait("BP (461).txt - Notepad","") If Not WinActive("BP (461).txt - Notepad","") Then WinActivate("BP (461).txt - Notepad","") WinWaitActive("BP (461).txt - Notepad","") Send("{DOWN}{HOME}{SHIFTDOWN}{END}{SHIFTUP}{CTRLDOWN}c{CTRLUP}{ALTDOWN}{TAB}{ALTUP}") WinWait("Welcome to Rediffmail: - Opera","") If Not WinActive("Welcome to Rediffmail: - Opera","") Then WinActivate("Welcome to Rediffmail: - Opera","") WinWaitActive("Welcome to Rediffmail: - Opera","") MouseMove(267,205) MouseDown("left") MouseUp("left") Send("{CTRLDOWN}a{CTRLUP}{CTRLDOWN}v{CTRLUP}{ALTDOWN}{TAB}{ALTUP}") WinWait("BP (461).txt - Notepad","") If Not WinActive("BP (461).txt - Notepad","") Then WinActivate("BP (461).txt - Notepad","") WinWaitActive("BP (461).txt - Notepad","") Send("{DOWN}{HOME}{SHIFTDOWN}{END}{SHIFTUP}{CTRLDOWN}c{CTRLUP}{ALTDOWN}{TAB}{ALTUP}") WinWait("Welcome to Rediffmail: - Opera","") If Not WinActive("Welcome to Rediffmail: - Opera","") Then WinActivate("Welcome to Rediffmail: - Opera","") WinWaitActive("Welcome to Rediffmail: - Opera","") Send("{TAB}{CTRLDOWN}v{CTRLUP}{ALTDOWN}{TAB}{ALTUP}") WinWait("BP (461).txt - Notepad","") If Not WinActive("BP (461).txt - Notepad","") Then WinActivate("BP (461).txt - Notepad","") WinWaitActive("BP (461).txt - Notepad","") Send("{DOWN}{HOME}{SHIFTDOWN}{END}{SHIFTUP}{CTRLDOWN}c{CTRLUP}{ALTDOWN}{TAB}{ALTUP}") WinWait("Welcome to Rediffmail: - Opera","") If Not WinActive("Welcome to Rediffmail: - Opera","") Then WinActivate("Welcome to Rediffmail: - Opera","") WinWaitActive("Welcome to Rediffmail: - Opera","") Send("{TAB}{CTRLDOWN}v{CTRLUP}") MouseMove(212,679) MouseDown("left") MouseUp("left") Link to comment Share on other sites More sharing options...
MisterBates Posted July 2, 2007 Share Posted July 2, 2007 I'm sorry if this has been asked before, I did search but all I could find were macros alot more complex than what I am capable of understanding and need.Basically I need to be able to run my macro once when I hit a hotkey.This is my macro, I need to be able to run this macro once when I hit a key on the keyboard.Thanks in advance,Sounds like you want to associate this macro with a windows hotkey? AutoIt knows about hotkeys, but needs to be running to "see" the keypress... [u]MisterBates[/u]_____________________________________________________Suspend/Resume Windows ScreensaverWatchWindows - Window watcher/loggerUDF: Click systray menu/submenu itemsUDF: Outlook Express Folder/Message handling (+ example code)HowTo: Multiple icons in one compiled script Link to comment Share on other sites More sharing options...
f901 Posted July 2, 2007 Author Share Posted July 2, 2007 I encounted problems with the HotKeySet function before with the macro going into a loop, but I got that sorted by adding sleep(100) at the end of the macro.So problem sorted Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now