#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. ; NOTE: ; ; In Windows 10, you can just hit "Win-P" and choose "Extend" instead of using this script. ; ^!+s:: ; Open display settings Send, #i Sleep 1000 Send, change display settings Sleep 1000 Send, {Enter} Sleep 500 Send, {Enter} Sleep 500 ; Go to the monitor selection Send, {Tab}{Tab}{Tab}{Tab}{Tab} Send, {Enter} ; Choose duplicate 1 and 2 Send, {Up}{Up}{Enter} ; Keep changes Sleep 500 Send, {Tab}{Enter} ; Wait for changes, select extend 2. Sleep 2000 Send, {Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Enter}{Down}{Enter} ; Keep changes Sleep 500 Send, {Tab}{Enter} ; Wait for changes, select duplicate on 3. Sleep 2000 Send, {Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Enter}{Up}{Enter} ; Keep changes Sleep 500 Send, {Tab}{Enter} ; Wait for changes, select extend on 3. Sleep 2000 Send, {Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Enter}{Down}{Enter} ; Keep changes Sleep 500 Send, {Tab}{Enter} Sleep 5000 Send, !{F4} return