-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.applescript
47 lines (43 loc) · 1.17 KB
/
main.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 Next to "n"
set Previous to "p"
set Like to "l"
set Lyrics to "lyrics"
on is_running(appName)
tell application "System Events" to (name of processes) contains appName
end is_running
if not is_running("NeteaseMusic") then
tell application "NeteaseMusic" to activate
delay 3
end if
if query is equal to "" then
tell application "System Events"
tell process "NeteaseMusic"
click menu item 1 of menu "Controls" of menu bar 1
end tell
end tell
else if query is equal to Next then
tell application "System Events"
tell process "NeteaseMusic"
click menu item 2 of menu "Controls" of menu bar 1
end tell
end tell
else if query is equal to Previous then
tell application "System Events"
tell process "NeteaseMusic"
click menu item 3 of menu "Controls" of menu bar 1
end tell
end tell
else if query is equal to Like then
tell application "System Events"
tell process "NeteaseMusic"
click menu item "Like" of menu "Controls" of menu bar 1
end tell
end tell
else if query is equal to Lyrics then
tell application "System Events"
tell process "NeteaseMusic"
click menu item 9 of menu "Controls" of menu bar 1
end tell
end tell
end if