system("Macintosh HD/Applications/VLC");
this is what I have in my program, but it says
sh: line 1: Macintosh:command not found
i tried using my home directory...
system ("markspangler/Applications/VLC");
but it tells me "no such directory"....
any more help?
(do i need a specific #include file?)
This doesn't work, because what the system sees is the line
Macintosh HD/Applications/VLC
which is interpreted as the command "Macintosh" with a parameter "HD/Application/VLC". Using the "system" command is difficult and can be extremely dangerous. The same code would also not work on any computer where the hard disk isn't called "Macintosh HD".
Typing "LaunchApplication" into spotlight should show you a document "Launch Services Reference", which contains the recommended way to launch applications. For example, the call "LSOpenItemsWithRole" will "open" any number of items, including applications, as if you had double-clicked their icon, and it will do the Right Things.