[localhost:~]$ cat * > /dev/ragfield

Wednesday, October 21, 2009

Play a specific track in iTunes from Mathematica

A coworker was making a presentation and asked me for a function he could trigger with Button[] to start playing a specific track in iTunes (on a Mac). This gets the job done:
iTunesPlay[playlist_String, track_Integer] := Run[StringJoin[
        "osascript -e 'tell application \"iTunes\" to play track ",
        ToString[track], " of user playlist \"", playlist, "\"'"
]];
iTunesPlay["Mix", 1]
iTunesPlay["Mix", 2]

2 comments:

Unknown said...

To listening my favorite podcasts and music I use iTunes for Mac software to manage, as iTunes portable latest download https://yepdownload.com/itunes-portable for my pc. It totally makes my day. I select music in the most thorough way, and in my playlist only the newest sound. Better app for all times. Try to use it some day.

Anonymous said...

Excessive vibration of CNC equipment whereas working, and the drive exerted from the constant shaking, can influence the durability of the elements. Nice Rapid started as an injection molding firm, and increase its enterprise by offering a 3D prototype, CNC prototype, and CNC low-volume manufacturing. The factory is also be|can be} geared up with a high-end machine heart referred to as Gamma CNC vertical machine heart, its spindle speed is as much as} 8,000rpm; whereas a traditional vertical machine heart is around 6,000rpm. In addition, Sundary is committed to supply a high-speed production, it promises to always full a prototype Men’s Loafer Slippers sample within every week, and it'll submit a few of} samples on your evaluation. Further, XY Global presents its services and products to international brands similar to Samsung, LG, Asus, Toshiba, Flextronics, and Fujitsu.