Create a MacOS X App Bundle Using MacPorts: Difference between revisions

→‎Use Platypus to produce a template for the App bundle: Add AppleScript approach to creating an App bundle
(→‎Use Platypus to produce a template for the App bundle: Add AppleScript approach to creating an App bundle)
Line 56: Line 56:
The DMG produced using the [http://www.octave.org/wiki/index.php?title=Prototype_MacPorts_PortFile prototype portfile's] does not include everything needed for Octave.  Both {{Codeline|macros.texi}}, {{Codeline|octave.info}}, and the {{Codeline|octave.info-#}} files are missing.  Until the cause for these missing files is identified and resolved, they will have to be copied manually to the App bundle.
The DMG produced using the [http://www.octave.org/wiki/index.php?title=Prototype_MacPorts_PortFile prototype portfile's] does not include everything needed for Octave.  Both {{Codeline|macros.texi}}, {{Codeline|octave.info}}, and the {{Codeline|octave.info-#}} files are missing.  Until the cause for these missing files is identified and resolved, they will have to be copied manually to the App bundle.


===Use Platypus to produce a template for the App bundle===
===Create an Application Template for Octave===


[[File:Platypus.png|400px|thumb|right|Initial Platypus Dialog (click to enlarge)]]
[[File:Platypus.png|350px|thumb|right|Initial Platypus Dialog (click to enlarge)]]
 
Below, two methods are described for producing an application template for Octave. 
 
====Use Platypus to produce a template for the App bundle====


To creating an application bundle for MacOS X the utility, [http://sveinbjorn.org/platypus Platypus], is used.  Platypus is a developer tool for the Mac OS X operating system which is intended to create native Mac OS X applications from interpreted scripts such as shell scripts or Perl, Ruby and Python programs.
To creating an application bundle for MacOS X the utility, [http://sveinbjorn.org/platypus Platypus], is used.  Platypus is a developer tool for the Mac OS X operating system which is intended to create native Mac OS X applications from interpreted scripts such as shell scripts or Perl, Ruby and Python programs.
Line 75: Line 79:
* Click the "Create" button.
* Click the "Create" button.
* Save the App bundle template to the location of your choice.
* Save the App bundle template to the location of your choice.
====Use Apple's AppleScript Editor to produce a template for the App bundle====
[[File:Platypus.png|350px|thumb|right|Initial Platypus Dialog (click to enlarge)]]
The itemized instructions below describe how to create an application template
for Ocave using an AppleScript.
* Run the "AppleScript Editor" and enter the script below.
<nowiki># Run the octave shell script that has be bundled.
tell application "Terminal"
# The script "launch_octave" will call the octave shell script and then close
  # this AppleScript when octave exits.
do script quoted form of POSIX path of (path to me) & "Contents/Resources/bin/launch_octave '" & (name of me) & "'; sleep 1; exit"
end tell</nowiki>
* Choose "Save As..." from the <b>File</b> menu.
** Specify the application name in the <b>Save As:</b> field.  For this example, use "Octave-3.7.0+.app".
** The <b>Where:</b> field specifies the location the application template will be saved to.
** The <b>File Format:</b> pull down should be set to "Application".
** Of the <b>Options</b>, only "Stay Open" should be checked.
** Click on <b>Save</b>.


===Populate the App Bundle===
===Populate the App Bundle===
364

edits