Resolved Wrapping shell scripts into a .app bundle

Discussion in 'Mac OS X Lion (10.7)' started by NorthDakota91, Feb 24, 2012.

  1. NorthDakota91, Feb 24, 2012
    Last edited: Feb 24, 2012

    macrumors member

    Joined:
    Sep 3, 2011
    Location:
    Italy
    #1
    Hey guys, I've got a little question here: is there a way to wrap a shell script into a .app bundle (so the script behaves like a normal app)? I've found a tutorial on the web where I had to create a folder, name it "something.app" and then create a minimal app structure inside (Contents folder with inside MacOS and Resources folders) with inside a little C application that launches the script however this doesn't seem to work on Lion (it gives me an error about unsopported PowerPC apps).

    Anyone has a clue on how can I do it? :)
     
  2. macrumors 6502a

    jasonvp

    Joined:
    Jun 29, 2007
    Location:
    Northern VA
    #2
    One sort of sledgehammer approach to it would be to write a quick AppleScript that calls your shell script. Then when you "Save As", just save it as an application. The AS editor will create the .app directory structure for you, and you'll be all set.

    Give that a shot?

    jas
     
  3. thread starter macrumors member

    Joined:
    Sep 3, 2011
    Location:
    Italy
    #3
    I now realize that I didn't explain my problem well (forgot to mention what kind of script I'd like to wrap).

    So, I'd like to wrap the minecraft bukkit server. It is made of a bunch of files/folders (server info, the map, and so on, let's call it "data stuff") and the script ("startserver.command", btw what is the difference between a .command file and a .sh file? :confused:) which calls java and launches the server. What I'd like to achieve here is to actually put the command file and the data stuff inside the app wrapper.

    Yes, AppleScript was the first thing I thought of and it kinda worked but the problem with it is that the data stuff is not inside the app so the server is not really wrapped. Any idea how can I put all the stuff inside the .app folder?

    And, btw, thank you for lightning fast answer :D
     
  4. macrumors G4

    Joined:
    Jul 17, 2002
    Location:
    USA
    #4
    I seem to recall a utility that converts shell scripts to double-clickable applications. However, I will not do the Google search for you. If it is important to you, then you can do your own Google search.
     
  5. thread starter macrumors member

    Joined:
    Sep 3, 2011
    Location:
    Italy
    #5
    First of all, thank you for pointing out the utility (was it appify?). I didn't know it existed. However it does not work, e.g. it creates the wrapper but all it does is jumping on the Dock until I kill it. I think that this is not the right place to ask what's wrong with it so I think that I'll just give up on this
     
  6. macrumors newbie

    Joined:
    Jul 8, 2008
    #6
  7. thread starter macrumors member

    Joined:
    Sep 3, 2011
    Location:
    Italy
    #7
    You, sir, are a genius :D thank you very much, it works like a charm :)
     

Share This Page