Skip to content

Commit

Permalink
update apple-music favorite song logic
Browse files Browse the repository at this point in the history
  • Loading branch information
hugivar committed Feb 19, 2024
1 parent 42a8711 commit efa6bcb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Living in the Library
# @raycast.mode fullOutput
# @raycast.mode silent

# Optional parameters:
# @raycast.icon images/apple-music-logo.png
Expand Down
32 changes: 3 additions & 29 deletions packages/raycast/scripts/apple-music/love-current-track.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,16 @@
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Love Current Track
# @raycast.mode fullOutput
# @raycast.mode silent

# Optional parameters:
# @raycast.icon images/apple-music-logo.png

osascript -e '
tell application "Music"
if player state is playing then
if kind of current track contains "song" then
set loved of current track to true
else
return "The current track is not a song."
end if
else
return "No track is currently playing."
end if
end tell'

osascript -e 'tell application "Music" to get kind of current track'

osascript -e '
tell application "Music"
if player state is playing then
set trackName to name of current track
set artistName to artist of current track
set albumName to album of current track
return "Track: " & trackName & ", Artist: " & artistName & ", Album: " & albumName
else
return "No track is currently playing."
end if
end tell'

osascript -e '
tell application "Music"
if player state is playing then
get kind of current track
set favorited of current track to true
log "<3 Yeah, that song is rad."
else
return "No track is currently playing."
end if
Expand Down

0 comments on commit efa6bcb

Please sign in to comment.