newbie: please help

Discussion in 'Mac Programming' started by macscriptnew, Jun 6, 2006.

  1. macrumors newbie

    Joined:
    Jun 6, 2006
    #1
    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
     
  2. Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #2
    Add .command as a file extension and any Darwin executable will automagically open Terminal.app and run.
     
  3. thread starter macrumors newbie

    Joined:
    Jun 6, 2006
    #3
    Yeah I figured that out but is there then a way to add an icon and file associations after i add the .command extension?
     
  4. Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #4
    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?
     
  5. thread starter macrumors newbie

    Joined:
    Jun 6, 2006
    #5
    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.
     
  6. Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #6
  7. thread starter macrumors newbie

    Joined:
    Jun 6, 2006
    #7
    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?
     
  8. thread starter macrumors newbie

    Joined:
    Jun 6, 2006
    #8
    as in what type of project should i build to simply run an executable but be able to add file associations and icons
     
  9. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #9
    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?
     
  10. macrumors 6502a

    Palad1

    Joined:
    Feb 24, 2004
    Location:
    London, UK
    #10

Share This Page