How to launch iTunes at startup with a random song?
I write this article in response to a question read on a forum, in the hope that it will help someone in addition to the direct question (Stefano, aka "Pisubijoux").
There are several methods to do this, I suggest using a small script (to be created with AppleScript Editor) to be launched when the user login.
We arrive at practical ...
1) Open the AppleScript editor and enter the following code (commented to help you understand ... ah, comments are inserted with "--" ):
-- Open iTunes
tell application "iTunes"
- Show window of iTunes running (remove "-")
- Activate
- Set shuffle mode to the playlist "Music" (Change it if you want)
September shuffle of user playlist "Music" to true
- Remove shuffle mode to the playlist "Music" (Change it if you want)
- Set shuffle of user playlist "Music" to false
- Play music!
play
end tell
2) Click on Compile and then save it as Application.
3) Open System Preferences -> Accounts -> Startup Items -> enter the application you just saved!
For the lazy, you can download the file directly from here:
Only ... then proceed to step 3!












