-
Notifications
You must be signed in to change notification settings - Fork 0
/
ToolVoxAIPopClip.txt
56 lines (56 loc) · 2.29 KB
/
ToolVoxAIPopClip.txt
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
49
50
51
52
53
54
55
56
# popclip
name: ToolVox AI
icon: symbol:waveform.circle.fill
AppleScript: | # pipe character begins a multi-line string
set theflag to "{popclip modifier flags}"
if (theflag = "131072") then
set SelectedText to "{popclip urlencoded text}"
set AppleScript's text item delimiters to "'"
set the itemList to every text item of SelectedText
set AppleScript's text item delimiters to "%27" -- URL encoded value for '
set SelectedText to the itemList as string
do shell script "open -g 'shortcuts://run-shortcut?name=ToolVox%20AI&input=" & SelectedText & "'"
else if (theflag = "1048576") then
tell application "Shortcuts Events"
set the TheResult to item 1 of (run shortcut named "ToolVox AI" with input "•dsr••dc••np•{popclip text}")
end tell
tell application "System Events"
set ClipboardHolder to (the clipboard as text)
delay 0.2
set the clipboard to TheResult
keystroke "v" using {command down}
delay 0.2
set the clipboard to ClipboardHolder
end tell
else if (theflag = "1572864") then
tell application "Shortcuts Events"
set the TheResult to item 1 of (run shortcut named "ToolVox AI" with input "•dsr••dc••np•{popclip text}")
end tell
tell application "System Events"
set ClipboardHolder to (the clipboard as text)
delay 0.2
set the clipboard to "{popclip text}" & ASCII character 10 & TheResult
keystroke "v" using {command down}
delay 0.2
set the clipboard to ClipboardHolder
end tell
else if (theflag = "1179648") then
set SelectedText to "{popclip urlencoded text}"
set AppleScript's text item delimiters to "'"
set the itemList to every text item of SelectedText
set AppleScript's text item delimiters to "%27" -- URL encoded value for '
set SelectedText to the itemList as string
do shell script "open -g 'shortcuts://run-shortcut?name=ToolVox%20AI&input=%E2%80%A2dc%E2%80%A2" & SelectedText & "'"
else
tell application "Shortcuts Events"
set the TheResult to item 1 of (run shortcut named "ToolVox AI" with input "•dsr•{popclip text}")
end tell
tell application "System Events"
set ClipboardHolder to (the clipboard as text)
delay 0.2
set the clipboard to TheResult
keystroke "v" using {command down}
delay 0.2
set the clipboard to ClipboardHolder
end tell
end if