20100828

simplest way to make an application bundle using nothing but notepad.

Create a Application Bundle in 3 easy steps ;)

No Xcode needed, just a filebrowser and a texteditor. While poking around with .app dirs I noticed that as soon as I provided a MacOS folder containing something executable named the same as the app, my tiger box happily starts to run it without needing or checking a .plist or anything....

Sweet :) 
here goes ;) 


* in the terminal:
 bash$ mkdir -p MyShinyShellScriptWrapper.app/MacOS  
 bash$ echo -e "#!/bin/bash\necho \$(date) >  ~/Desktop/proofofexecution.txt" \  >MyShinyShellScriptWrapper.app/MacOS/MyShinyShellScriptWrapper 
 bash$ chmod 755 MyShinyShellScriptWrapper.app/MacOS/MyShinyShellScriptWrapper 



* or in the finder:
Open a finder window and create a new folder.  Open it and in it create a MacOS folder, now decide on a name. Create a new (plain) text document in the newly created folder and name it YourProgramName
 Now type these two lines in the textdocument:
#!/bin/bash
echo $(date) > ~/Desktop/proofofexecution.txt
Right! Close the file and save it as YourProgramName without an extension. (eg no .txt or .html or .whatever)
Right click on the file and  select Get Info.  Here you.... pfff, here you DONT find a set permissions to executable.
Anyway, open up a Terminal and type chmod 755 YourProgramName and close it off/ (is this even neccessary?)
Now go 2 levels up in the folder and rename the folder that you created in the beginning to  YourProgramName.app

Now it should've turned into an application with a broken icon. This is good :) Double click the icon to start it up!

Nothing much happened? The script runs in the background and takes a nanosecond to finish so nothing much should happen, but on your Desktop 
You should now see a new file called proofofexecution containing a timestamp.

Shweeet





How to make a shell script into a apple macintosh app application bundle using nothing but common household tools ;-)



dd
Sweet :)

No comments:

Post a Comment