Skip to content

Instantly share code, notes, and snippets.

@aplocher
Created August 31, 2015 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aplocher/3de7ea54e40e18b96153 to your computer and use it in GitHub Desktop.
Save aplocher/3de7ea54e40e18b96153 to your computer and use it in GitHub Desktop.
AutoHotKey script to automate adding a toolbar to the taskbar in Windows
; Automates adding a toolbar to the taskbar in Windows
#SingleInstance force
; Change to the folder path to your toolbar
toolbarPath=OneDrive\System\Actions
ControlGet, handle, Hwnd,, TrayClockWClass1,,Notification Area
ControlClick, ,ahk_id %handle% ,,Right
WinWait,ahk_class #32768,,5
if ErrorLevel
{
MsgBox,Context Menu not found after 5 seconds
Exit
}
Sleep,400
Send,T{Enter}N
WinWaitActive,New Toolbar,,10
if ErrorLevel
{
MsgBox,New Toolbar Window not found after 10 seconds
Exit
}
Sleep,400
Send,!d ; ALT+D
Send,%toolbarPath%
Send,{Enter}
Sleep,400
Send,+{Tab}+{Tab} ; SHIFT+TAB, SHIFT+TAB
Sleep,400
Send,{Enter}
Exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment