diff --git a/Telegram FXTwitter Paste.ahk b/Telegram FXTwitter Paste.ahk new file mode 100644 index 0000000..e30c6a8 --- /dev/null +++ b/Telegram FXTwitter Paste.ahk @@ -0,0 +1,17 @@ +#Requires AutoHotkey v2 +#SingleInstance Force +#HotIf WinActive("ahk_exe Telegram.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" +}