Stap 3: Spotify osascript opdrachten
Ik heb gebouwd deze verwijzing met behulp van het volgende bestand:
/Applications/Spotify.app/Contents/Resources/Spotify.sdef
# Dit is een alleen-lezen
osascript -e 'tell application "Spotify" speler staat' # gestopt, spelen, onderbroken
osascript -e 'tell application "Spotify" naar huidige track' # de huidige spelen bijhouden.
osascript -e 'tell application "Spotify" op een illustratie van de huidige track' # afbeeldingsgegevens in TIFF-indeling.
osascript -e 'tell application "Spotify" aan kunstenaar van huidige track' # de artiest van de track.
osascript -e 'tell application "Spotify" to album van huidige track' # het album van de track.
osascript -e 'tell application "Spotify" to disc nummer van huidige track' # het nummer van de schijf van het spoor.
osascript -e 'tell application "Spotify" duur van huidige track' # de lengte van het spoor in seconden.
osascript -e 'tell application "Spotify" aan gespeelde graaf van huidige track' # het aantal keren dat deze track heeft gespeeld.
osascript -e 'tell application "Spotify" aantal van de huidige track te houden' # de index van het spoor in haar album.
osascript -e 'tell application "Spotify" to speelde van huidige track' # Is het nummer een ster?
osascript -e 'tell application "Spotify" aan populariteit van huidige track' # hoe populair is dit nummer? 0-100
osascript -e 'tell application "Spotify" to id van het huidige nummer' # de ID van het item.
osascript -e 'tell application "Spotify" op naam van de huidige track' # de naam van de track.
osascript -e 'tell application "Spotify" op een illustratie van de huidige track' # de track s albumcover.
osascript -e 'tell application "Spotify" aan album kunstenaar van huidige track' # die artiest van de track.
osascript -e 'tell application "Spotify" to spotify url van huidige track' # de URL van de track.
# Lees/schrijf
osascript -e 'tell application "Spotify" to speler positie' # de speler s positie binnen de eersteklasser track in seconden.
osascript -e 'tell application "Spotify" to set speler positie tot 20'
osascript -e 'tell application "Spotify" herhalende ingeschakeld' # Is herhalen ingeschakeld in de huidige context afspelen?
osascript -e 'tell application "Spotify" om in te stellen op true met herhalende ingeschakelde'
osascript -e 'tell application "Spotify" herhalende' # herhaalt in- of uitschakelen?
osascript -e 'tell application "Spotify" to set herhalende op true'
osascript -e 'tell application "Spotify" te schuifelen ingeschakeld' # Is schuifelen inschakelen in de huidige context afspelen?
osascript -e 'tell application "Spotify" te schuifelen' # Is shuffling in- of uitschakelen?
osascript -e 'tell application "Spotify" to geluidsvolume' # het volume van het geluid (0 = minimum, 100 = maximum)
osascript -e 'tell application "Spotify" to set geluidsvolume to 50'
# opdrachten
osascript -e 'tell application "Spotify" naar volgende track'
osascript -e 'tell application "Spotify" naar vorige track'
osascript -e "tell application"Spotify"to playpause"
osascript -e 'tell application 'Spotify' onderbreken'
osascript -e 'tell application 'Spotify' te spelen'
osascript -e ' vertellen toepassing "Spotify" op nummer afspelen "spotify: track: 3941McqnrX9blUEelPxgot" "
osascript -e ' vertellen toepassing "Spotify" op nummer afspelen "spotify: user: ni_co:playlist:7gsVkVqVPzw2pBDkJVHYYv" "
# Dit is een alleen-lezen
osascript -e 'tell application "Spotify" naam"# de naam van de toepassing.
osascript -e 'tell application "Spotify" to voorste' # Is dit de toepassing van de voorste (actief)?
osascript -e 'tell application "Spotify" naar versie' # de versie van de toepassing.
osascript -e 'tell application "Spotify" om te stoppen'