Skip to content

Commit c0e3ff6

Browse files
authored
Update Apple Music Search to work with Music.app and iTunes's coexistence. (raycast#637)
1 parent 7735885 commit c0e3ff6

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

commands/media/apple-music/apple-music-search.applescript

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@ on run argv
2121
try
2222
do shell script "open /System/Applications/Music.app"
2323
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
2831
end try
2932

3033
# Argh, the window title varies... Add your language if it's not here...
@@ -33,8 +36,8 @@ on run argv
3336
set toLaunch to true
3437

3538
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
3841
delay 0.5
3942
end repeat
4043

0 commit comments

Comments
 (0)