Files
BoopScripts/FXTwitter Paste.ahk
2024-10-17 23:26:35 +01:00

18 lines
451 B
AutoHotkey

#Requires AutoHotkey v2
#SingleInstance Force
#HotIf WinActive("ahk_exe Telegram.exe") or WinActive("ahk_exe Discord.exe")
Persistent
^v:: { ; On Ctrl+V
fixedText := RegExReplace(
A_Clipboard,
'https?:\/\/(?:mobile\.)?(?:x|twitter)\.com\/(\w+)\/status\/(\d+)',
'https://fxtwitter.com/$1/status/$2',
&ReplacementCount,
)
if (ReplacementCount > 0) {
A_Clipboard := fixedText
}
Send "^v"
}