Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. set AirplayDeviceName to "Kitchen" // название устройства airplay к которому будем подключаться
  2. set PlaylistName to "Morning" // название плейлиста который будем играть
  3. set AirplayVolume to 100 // громкость тунца
  4.  
  5. activate application "iTunes" //открываем программу itunes
  6.  
  7. tell application "System Events"
  8. tell application "iTunes"
  9. set visible of front browser window to true
  10. set the view of the front browser window to playlist PlaylistName
  11. end tell
  12. end tell // открываем окно тунца и переходим к плейлисту
  13.  
  14. tell application "iTunes"
  15. set AirplayNames to (get name of AirPlay devices)
  16. set AirplayDevices to (get AirPlay devices)
  17. set AirplayToPlay to {}
  18. repeat with i from 1 to length of AirplayNames
  19. if item i of AirplayNames as string = AirplayDeviceName then set end of AirplayToPlay to item i of AirplayDevices
  20. end repeat
  21. set current AirPlay devices to AirplayToPlay
  22. end tell // собственно подключаемся к устройству воспроизведения
  23.  
  24. tell application "iTunes"
  25. play playlist PlaylistName
  26. set the sound volume to AirplayVolume
  27. end tell // ну и тут все просто запускаем плейлист с заданной громкостью можно написать еще play track "Not Ready to Make Nice" of playlist "Dixie Chicks" что бы играл с определенного трека в определенном плейлисте или просто play track 1 of playlist "Dixie Chicks"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement