Skip to content

Instantly share code, notes, and snippets.

; this example uses alt-c to toggle the conversation view, customize the keystroke as desired
; see https://gist.github.com/ajkessel/b382d5bb63dc5b9b17dc7f2ee8f9789f for ClickAllmailboxes.ahk
#Requires AutoHotkey v2.0
#SingleInstance force
!c:: {
Run 'ClickAllmailboxes.ahk'
Outlook := Outlook ?? ComObjActive("Outlook.Application")
Outlook.ActiveExplorer.CommandBars.ExecuteMso('ShowInConversations')
}
; This AutoHotkey script looks for the popup that occurs in Microsoft Outlook when the user toggles the conversation view and automatically clicks "all mailboxes"
; It is intended to be called from https://gist.github.com/ajkessel/0124db8cf957a9591e604df18236dba8
#Requires AutoHotkey v2.0
#SingleInstance force
SetControlDelay -1
count := 0
IsVisible := False
sleep 10
while not IsVisible AND count < 100 {
try {
#include UIA-v2\Lib\UIA.ahk
#include UIA-v2\Lib\UIA_Browser.ahk
#HotIf WinActive("ahk_exe msedge.exe")
; ctrl-shift-w: close other tabs
^+w:: {
WinWaitActive "ahk_exe msedge.exe"
edgeWindow := UIA.ElementFromHandle("ahk_exe msedge.exe")
edge := UIA_Edge("")
tab := edge.GetTab()
@ajkessel
ajkessel / powershellgui.ps1
Created August 21, 2024 21:33
A simple PowerShell GUI clickable form with four buttons
# it is oddly difficult to find good, easy examples of creating PowerShell GUI forms with non-standard buttons
# this is a simple example that displays a four-button form
# you can, of course, customize everything in the <grid>
# and will need to set the window width and height to match the number of buttons and font
# use and adapt freely, subject to unlicense https://choosealicense.com/licenses/unlicense/
[void][System.Reflection.Assembly]::LoadWithPartialName('presentationframework')
[xml]$XAML = @'
<Window
xmlns =
"http://schemas.microsoft.com/winfx/2006/xaml/presentation"