NetBeans, Java, AppleScript and iTunes – Part 2Tweet
In part 1 of this series I demonstrated how to create a short Java application in NetBeans that communicated, using AppleScript, to the Mac apple event system. The application was a no thrills look into how to invoke the TextEdit application. Despite the brevity of the application it provided the foundation for this next tip, which will build on the ideas to create something a little more salient, as in, something that you might actually find yourself using.
The gist of the application is to instruct iTunes to play a random song, move to the next song, pause, etc. I’ll show one use of the application by wrapping the code into a bash script that allows you to invoke the program (and all commands) from within a terminal. Watch the video that follows for all the details…
This application is all of about 80 lines, including the bash script. Sometimes a little creative thinking and a few lines of code are all that’s needed to write an intriguing (and hopefully useful) application.
The music in the video is Led Zeppelin and the song: Moby Dick. Led Zeppelin at Amazon