-
Notifications
You must be signed in to change notification settings - Fork 2
/
ClipboardSelectLinks.ahk
48 lines (40 loc) · 1.19 KB
/
ClipboardSelectLinks.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
F3:: Reload
F8::
Click, 3
Sleep, 50
; Save the currently selected text to a variable
Clipboard := "" ; Clear the clipboard
SendInput, ^c ; Simulate Ctrl + C to copy selected text
ClipWait, 1 ; Wait for 1 second for the clipboard to contain data
; Check if text is copied successfully
If ErrorLevel
{
MsgBox, No text was selected!
Return
}
; Save the copied text into a variable
input := Clipboard
; Define a regular expression pattern to capture the hashtag and TestFlight link
pattern := "#.*\w"
; Use RegExMatch to extract the matched pattern from the input
if (RegExMatch(input, pattern, match)) {
Clipboard := match
}
if WinExist("ahk_exe Telegram.exe")
{
WinActivate ; Use the window found by WinExist.
Sleep, 100
Send, ^v
Sleep, 100
Send, {ENTER}
}
Return
F7::
; Save the currently selected text to a variable
Clipboard := "" ; Clear the clipboard
SendInput, ^c ; Simulate Ctrl + C to copy selected text
ClipWait, 1 ; Wait for 1 second for the clipboard to contain data
Send, ^t
Sleep, 100
Send, ^v appstore{ENTER}
return