Airplane Mode Toggle

Post your working scripts, libraries and tools for AHK v1.1 and older
serg
Posts: 56
Joined: 21 Mar 2015, 05:33

Airplane Mode Toggle

Post by serg » 02 Dec 2021, 08:53

I couldn't find script here on forum to toggle Airplane Mode, so I came up with this simple solution, maybe someone will find it useful:

1. Create "GodMode" folder:
- Right-Click -> New.. -> Folder
- Rename it to "GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}"
2. In GodMode folder, find "Connect to a network" and create shortcut to it (right-click -> create...)
3. Use AHK script to toggle Airplane Mode:

Code: Select all

F1::
run %A_Desktop%\Connect to a network.lnk
sleep, 200
send {down}{space}				; <- send keystrokes to select/toggle "Airplane Mode"
winactivate, ahk_class WorkerW	; <- activate Desktop
return

User avatar
TheDewd
Posts: 1507
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Airplane Mode Toggle

Post by TheDewd » 03 Dec 2021, 10:32

Code: Select all

#SingleInstance, Force

F1::
	Run, ms-settings:network-airplanemode
	WinWait, Settings ahk_class ApplicationFrameWindow
	WinActivate, Settings ahk_class ApplicationFrameWindow
	WinWaitActive, Settings ahk_class ApplicationFrameWindow
	Sleep, 1000
	Send, {Space}
	WinClose, Settings ahk_class ApplicationFrameWindow
return

serg
Posts: 56
Joined: 21 Mar 2015, 05:33

Re: Airplane Mode Toggle

Post by serg » 04 Dec 2021, 06:20

@TheDewd, thanks for suggestion, though "Run, ms-settings:network-airplanemode" works only on Win10 (not on Win8.1 which I have)

Post Reply

Return to “Scripts and Functions (v1)”