Wednesday, May 20, 2020

Can't move off-screen window into active view

If a window is off screen from a disconnected secondary monitor and won't move into view with Win + Arrow Key, try restoring it by making it full screen with keyboard command Alt + Enter.

Saturday, May 16, 2020

Delete a specific cookie using autohotkey

To delete cookies, we edit the .sqlite database file in Firefox's APPDATA containing Mozilla Firefox's cookies.

Run DB Browser from the Command Prompt (cmd.exe) with command line options to run a SQL script (-s ) on the cookie database file and quit after execution (-q)

AutoHotkey script code:
   run, cmd.exe
Send "%path_dbbrowser%" -s "%path_sqlscript%" -q "%path_cookie%"{ENTER}
In context:
    ; // program paths
    path_cookie := "C:\Users\__USERNAME__\AppData\Roaming\
    Mozilla\Firefox\Profiles\__PROFILENAME__\cookies.sqlite"     path_dbbrowser := "D:\Program Files\DB Browser for SQLite\
    DB Browser for SQLite.exe"     path_sqlscript := "E:\Code\autohotkey scripts\cox\deletecookies.sql"
    
    cmd_timeout_sec := 10 ; time to wait for command prompt to respond

    run, cmd.exe
WinActivate ahk_exe cmd.exe
WinWaitActive ahk_exe cmd.exe, , %cmd_timeout_sec%
Send "%path_dbbrowser%" -s "%path_sqlscript%" -q "%path_cookie%"{ENTER}
    Send Exit{ENTER}
Remember to declare variables as global inside the functions, if they were assigned in the main execution.

SQL script contents:

DELETE FROM moz_cookies WHERE host like "%cox%"; 

Relevant Applications:

DB Browser for SQLite
Autohotkey
Mozilla Firefox