How can I play a specific song in iTunes via java?

How can I play a specific song in iTunes via java?

I'm guessing I need to somehow connect to iTunes and use the play feature with a specific parameter .... Can anyone point me in the right direction to see how to do this?

+1


source to share


2 answers


According to which the answer is , there is no API. For Windows, there is only SDK (via COM). On Mac OS iTunes is controlled by AppleScript ( example ).



+1


source


Ik too late, but you can use apple script editor. eg,

Runtime runtime = Runtime.getRuntime();
                String[] args = {"osascript" , "-e" , "tell application \"iTunes\" to play"};
                try{
                Process process = runtime.exec(args);
                }catch (Exception ex) {                 
                }

      



the song will play in itunes

0


source







All Articles