Skip to content

Instantly share code, notes, and snippets.

View rppig42's full-sized avatar
🏠
Working from home

rppig42

🏠
Working from home
View GitHub Profile
@rppig42
rppig42 / prevent-safari-cmd-w
Last active November 29, 2024 04:42
hammerspoon script to prevent safari closing window with cmd+w
script = [[
tell application "Safari"
set numWin to count of tabs of window 1
if numWin > 1 then
close current tab of front window
end if
if numWin = 1 then
tell application "System Events"
keystroke "t" using command down
end tell
@rppig42
rppig42 / kill-wechat.lua
Created April 10, 2019 01:35
休眠时注销Mac微信,以避免其手机消息禁音
script = [[
tell application "WeChat" to activate
tell application "System Events"
tell process "WeChat"
key code 43 using {command down}
end tell
end tell
tell application "System Events"