Sign in to follow this  
Followers 0
f901

Hotkey to run once

3 posts in this topic

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,

CODE
Opt("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")

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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 :rolleyes:

Share this post


Link to post
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
Sign in to follow this  
Followers 0