Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set AirplayDeviceName to "Kitchen" // название устройства airplay к которому будем подключаться
- set PlaylistName to "Morning" // название плейлиста который будем играть
- set AirplayVolume to 100 // громкость тунца
- activate application "iTunes" //открываем программу itunes
- tell application "System Events"
- tell application "iTunes"
- set visible of front browser window to true
- set the view of the front browser window to playlist PlaylistName
- end tell
- end tell // открываем окно тунца и переходим к плейлисту
- tell application "iTunes"
- set AirplayNames to (get name of AirPlay devices)
- set AirplayDevices to (get AirPlay devices)
- set AirplayToPlay to {}
- repeat with i from 1 to length of AirplayNames
- if item i of AirplayNames as string = AirplayDeviceName then set end of AirplayToPlay to item i of AirplayDevices
- end repeat
- set current AirPlay devices to AirplayToPlay
- end tell // собственно подключаемся к устройству воспроизведения
- tell application "iTunes"
- play playlist PlaylistName
- set the sound volume to AirplayVolume
- 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