Post

Replies

Boosts

Views

Activity

Reply to Trouble with AppleScript Permissions and ShazamKit Integration in macOS App
thank you for your help, ok, I will focus simply on the Applescript. I am targeting the Mac App Store, I have been able to write an app in Python, that used applescript, and I was able to get it to do all of the commands my app required, open the Music app, Play songs from the specified Playlist, set specific playback points, cylce through the playlist, and then I had it scrape infromation from Shazams website, and then the AppleScript was able to replace the metadata it found from the website in the specified Playlist in Music. Without interacting with shazam I removed the second part of teh applescript that re writes the metadata to keep it simple, and this apple script Im providing is able to open the Music App. Cylce through the specified Playlist, & play each song at the specfied playback points.Im using script editor to run the script and it seems to work. tell application "Music" set thePlaylist to playlist "Playlist Plunderer" if (count of tracks of thePlaylist) < 1 then display dialog "Playlist does not have any tracks." return end if repeat with theTrack in tracks of thePlaylist set trackDuration to duration of theTrack -- Play track at specified percentages repeat with p in {0.15, 0.5, 0.75} play theTrack delay 1 set player position to trackDuration * p delay 4 stop end repeat end repeat end tell
Jul ’24