File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
commands/media/apple-music Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,13 @@ on run argv
21
21
try
22
22
do shell script " open /System/Applications/Music.app"
23
23
tell application " Music" to activate
24
- end try
25
- try
26
- do shell script " open /Applications/iTunes.app"
27
- tell application " iTunes" to activate
24
+ set using to " Music"
25
+ on error
26
+ try
27
+ do shell script " open /Applications/iTunes.app"
28
+ tell application " iTunes" to activate
29
+ set using to " iTunes"
30
+ end try
28
31
end try
29
32
30
33
# Argh, the window title varies... Add your language if it's not here...
@@ -33,8 +36,8 @@ on run argv
33
36
set toLaunch to true
34
37
35
38
repeat while toLaunch
36
- if application " Music" is running then set toLaunch to false
37
- if application " iTunes" is running then set toLaunch to false
39
+ if using is " Music " and application " Music" is running then set toLaunch to false
40
+ if using is " iTunes " and application " iTunes" is running then set toLaunch to false
38
41
delay 0.5
39
42
end repeat
40
43
You can’t perform that action at this time.
0 commit comments