Skip to content

Commit 3738ac2

Browse files
author
Aadharsh Pannirselvam
committed
mirrored track logic changes to test version
1 parent 1495c2b commit 3738ac2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

spotty/spotty_test.applescript

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
local trackID
21
tell application "Spotify" to activate -- launches spotify
32
on idle
43
repeat while application "Spotify" is running
5-
check()
6-
delay 0.5
4+
check()
5+
delay 0.5
76
end repeat
87
quit
98
end idle
@@ -13,6 +12,10 @@ on quit -- binds spotty and spotify so that spotify quits when we quit spotty
1312
continue quit
1413
end quit
1514

15+
on getTrack()
16+
tell application "Spotify" to get id of current track
17+
end getTrack
18+
1619
on relaunch() -- quit, then relaunch and play
1720
tell application "Spotify"
1821
quit
@@ -24,8 +27,5 @@ on relaunch() -- quit, then relaunch and play
2427
end relaunch
2528

2629
on check()
27-
try
28-
tell application "Spotify" to set trackID to id of current track -- grab track ID
29-
if (offset of "ad" in trackID) = 9 then relaunch() -- checks if the track is an ad and relaunches if it is
30-
end try
30+
if (offset of "ad" in getTrack()) = 9 then relaunch() -- checks if the track is an ad and relaunches if it is
3131
end check

0 commit comments

Comments
 (0)