Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

macscriptnew

macrumors newbie
Original poster
Jun 6, 2006
6
0
Hey all,

I am new to macs coming from pc, I have a unix executable that i need to have an icon and file associations. Is there a way in XCode to simply make an application that runs my unix executable when the application's icon is double clicked?

please help.

-M
 

yellow

Moderator emeritus
Oct 21, 2003
16,018
6
Portland, OR
Add .command as a file extension and any Darwin executable will automagically open Terminal.app and run.
 

macscriptnew

macrumors newbie
Original poster
Jun 6, 2006
6
0
Yeah I figured that out but is there then a way to add an icon and file associations after i add the .command extension?
 

yellow

Moderator emeritus
Oct 21, 2003
16,018
6
Portland, OR
Google for how to add an icon to a Mac file..

I don't know what you mean by "file associations".. isn't it associated with Terminal.app because it's a UNIX executable?
 

macscriptnew

macrumors newbie
Original poster
Jun 6, 2006
6
0
The executable is a program used to analyze data so it needs to be able to open the data files and this can be done once the program is running by opening the files but i wanted to be able to double click on a data file and have it open the executable program.
 

macscriptnew

macrumors newbie
Original poster
Jun 6, 2006
6
0
Ok I guess my real question is then, what kind of application do i choose when all I want it to do is run the executable?
 

macscriptnew

macrumors newbie
Original poster
Jun 6, 2006
6
0
as in what type of project should i build to simply run an executable but be able to add file associations and icons
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
You might want to read these two articles:

Wrapping a Unix Executable 1


Wrapping a Unix Executable 2

Note that these actually end up with you having a Cocoa GUI that wraps the Unix executable. I think you will end up needing to have some sort of real app that OSX thinks is an app to get the file associations working. Instead of writing a GUI you could write a tiny little bit of Cocoa and AppleScript to work out where the file is when you are asked to execute it and then run the script with the correct args in Terminal.

The again, maybe you want a cool Cocoa GUI?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.