PDA

View Full Version : [Resolved] Wrapping shell scripts into a .app bundle




NorthDakota91
Feb 24, 2012, 07:19 AM
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? :)



jasonvp
Feb 24, 2012, 07:32 AM
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)?

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

NorthDakota91
Feb 24, 2012, 07:51 AM
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.

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

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

MisterMe
Feb 24, 2012, 08:31 AM
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 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.

NorthDakota91
Feb 24, 2012, 09:03 AM
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.

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

seppler
Feb 24, 2012, 09:53 AM
I think Platypus should work for you:

http://sveinbjorn.org/platypus

Thanks,

Steven

NorthDakota91
Feb 24, 2012, 10:45 AM
I think Platypus should work for you:

http://sveinbjorn.org/platypus

Thanks,

Steven

You, sir, are a genius :D thank you very much, it works like a charm :)