Skip to content

Instantly share code, notes, and snippets.

@toshiharu
Created March 19, 2013 18:28
Show Gist options
  • Save toshiharu/5198760 to your computer and use it in GitHub Desktop.
Save toshiharu/5198760 to your computer and use it in GitHub Desktop.
iTunes の「ミュージック」ライブラリ内にある曲をランダムに再生する AppleScript だと思いたい。AppleScript エディタ上でしか実行の確認をしていない。
tell application "iTunes"
set musicPlaylist to playlist "ミュージック"
set view of front browser window to musicPlaylist
set numberOfTracks to (count of tracks of musicPlaylist)
set randomNumber to (random number from 1 to numberOfTracks)
play track randomNumber of musicPlaylist
reveal current track
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment