Skip to main content

Running Itunes from my application

2 replies [Last post]
paultaylor
Offline
Joined: 2003-12-04
Points: 0

I have an application which allows the user to specify an application to use to open selected music files (mp3s). On Windows they may select an application such as Winamp and then the files they want to play are passed as parameters and Winamp is called using the Process class.
On MacOSX I want to do the same thing with Itunes, this is complicated by the fact the that the Itunes exectuable is hidden with Itunes.app/MacOS but even if I harcode the full path name it justs falls over with a bus error, can JDIC help me with a solution to this problem

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
georgez
Offline
Joined: 2003-08-19
Points: 0

Hi,

I think Joshua provided an easy way around it.

But you can also use the JDIC 0.8.6 release for MacOC:
jdic-0.8.6-bin-macosx.tar.gz at:
https://jdic.dev.java.net/servlets/ProjectDocumentList?folderID=1955&exp...

Then use Desktop.open(mp3 file path).

Have a try and give your feedback.

Thanks,
-George.

Joshua Marinacci

You don't want to run the executable inside of the .app folder. As far
as MacOSX is concerned the .app *is* the executable. If all you want to
do is open an mp3 file then you might have more luck with the 'open'
commandline program.

System.exec("open song.mp3");

that should pop up itunes (or another program if the user selected a
different default mp3 handler).

- Joshua

jdic@javadesktop.org wrote:

> I have an application which allows the user to specify an application to use to open selected music files (mp3s). On Windows they may select an application such as Winamp and then the files they want to play are passed as parameters and Winamp is called using the Process class.
> On MacOSX I want to do the same thing with Itunes, this is complicated by the fact the that the Itunes exectuable is hidden with Itunes.app/MacOS but even if I harcode the full path name it justs falls over with a bus error, can JDIC help me with a solution to this problem
> ---
> [Message sent by forum member 'paultaylor' (paul taylor)]
>
> http://www.javadesktop.org/forums/thread.jspa?messageID=42222&#42222
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jdic-unsubscribe@jdic.dev.java.net
> For additional commands, e-mail: jdic-help@jdic.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: jdic-unsubscribe@jdic.dev.java.net
For additional commands, e-mail: jdic-help@jdic.dev.java.net