Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HotKeySet("+d", "HotKeyPressed1")
- HotKeySet("s", "HotKeyPressed2")
- While 1
- Sleep(10)
- WEnd
- Func HotKeyPressed1()
- Run("control.exe main.cpl") ; Opens the Mouse Properties Control Panel applet
- Sleep(3000)
- WinWaitActive("Mouse Properties") ; Waits for the window to open
- Sleep(3000) ; (Optional) Pauses 3 seconds so you can watch the script work
- Send("!s{ENTER}") ; Types ALT+s then presses the Enter key
- EndFunc
- Func HotKeyPressed2()
- Send("{SHIFTDOWN}")
- MouseClick("LEFT")
- Send("{SHIFTUP}")
- EndFunc
- CODE2:
- ; This script types Hello World in a Word document.
- ; Before running this script, open Word and save the file as hello.docx (or hello.doc).
- ; The names must be in lower case to match the script.
- HotKeySet("+f", "HotKeyPressed1")
- HotKeySet("+g", "HotKeyPressed2")
- While 1
- Sleep(10)
- WEnd
- Func HotKeyPressed1()
- Opt("WinTitleMatchMode", 2) ; Configures AutoIt to find a search term in any part of the window title
- WinActivate("testing") ; Activates the Word window with hello.docx (or hello.doc) in any part of the title bar
- WinWaitActive("testing") ; Waits for the window to be the active window
- Send("Hello World") ; Types Hello World
- EndFunc ;to stop script from closing
- Func HotKeyPressed2()
- Opt("WinTitleMatchMode", 2)
- ;Run ("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe https://google.com​")`
- ShellExecute("chrome.exe", "https://google.com​ --new-window --start-fullscreen")
- sleep (5000)
- Send("tab nation autohotkey{ENTER}")
- sleep (5000)
- WinClose("tab nation")
- MsgBox(0, "title here", "Chrome window has been closed",)
- EndFunc ;to stop script from closing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement