forked from willisworley/AW_NeteaseAlfredController
-
Notifications
You must be signed in to change notification settings - Fork 0
/
controller.applescript
47 lines (44 loc) · 1.69 KB
/
controller.applescript
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
set query to "{query}"
set PAUSE to "pause"
set PAUSE_SHORT to ""
set NEXT to "next"
set NEXT_SHORT to "n"
set PREVIOUS to "prev"
set PREVIOUS_SHORT to "p"
set LOVE to "love"
set LOVE_SHORT to "l"
set VOLUME_UP to "volu"
set VOLUME_DOWN to "vold"
set VOLUME_UP_SHORT to "vu"
set VOLUME_DOWN_SHORT to "vd"
set LYRICS to "lyrics"
set LYRICS_SHORT to "r"
if query is equal to PAUSE or query is equal to PAUSE_SHORT then
tell application "System Events"
key code 18 using {command down, option down, control down, shift down}
end tell
else if query is equal to NEXT or query is equal to NEXT_SHORT then
tell application "System Events"
key code 20 using {command down, option down, control down, shift down}
end tell
else if query is equal to PREVIOUS or query is equal to PREVIOUS_SHORT then
tell application "System Events"
key code 19 using {command down, option down, control down, shift down}
end tell
else if query is equal to LOVE or query is equal to LOVE_SHORT then
tell application "System Events"
key code 22 using {command down, option down, control down, shift down}
end tell
else if query is equal to VOLUME_UP or query is equal to VOLUME_UP_SHORT then
tell application "System Events"
key code 21 using {command down, option down, control down, shift down}
end tell
else if query is equal to VOLUME_DOWN or query is equal to VOLUME_DOWN_SHORT then
tell application "System Events"
key code 23 using {command down, option down, control down, shift down}
end tell
else if query is equal to LYRICS or query is equal to LYRICS_SHORT then
tell application "System Events"
key code 26 using {command down, option down, control down, shift down}
end tell
end if