NeoOffice Launch Shortcuts

From NeoWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 21:46, 4 October 2008 (edit)
Sardisson (Talk | contribs)
m (Improved shell script - spell out neo one place i missed)
← Previous diff
Revision as of 05:37, 5 October 2008 (edit) (undo)
Sardisson (Talk | contribs)
(CFBundleExecutable - switch to use jochenf's script format only, since it matches the well-tested swriter, etc., ones that ship with NeoOffice)
Next diff →
Line 64: Line 64:
===Sample shell script=== ===Sample shell script===
- #!/bin/sh 
- /Applications/NeoOffice.app/Contents/MacOS/soffice.bin -nodefault 
- 
-This script, when saved as an executable file (e.g. <tt>/Applications/NeoOffice.app/Contents/MacOS/soffice-nodefault</tt>) and set as the CFBundleExecutable will start NeoOffice without the default Writer document. 
- 
-===Improved shell script=== 
- 
-On trinity, user jochenf [https://trinity.neooffice.org/modules.php?name=Forums&file=viewtopic&p=47307#47307 writes]: 
- 
-The script shown above has 2 disadvantages: 
-# It is not location independent, it assumes your NeoOffice is installed in /Applications. 
-# It leaves a shell open while running NeoOffice 
- 
-I would suggest the following script: 
- 
<pre>#!/bin/sh <pre>#!/bin/sh
Line 84: Line 69:
exec "$cmd" -nodefault "$@"</pre> exec "$cmd" -nodefault "$@"</pre>
-The first line determines the location of the executable, the second line starts NeoOffice and terminates the shell. When saved as an executable file (e.g. <tt>/Applications/NeoOffice.app/Contents/MacOS/soffice-nodefault</tt>) and set as the CFBundleExecutable, it will start NeoOffice without the default Writer document.+This script, when saved as an executable file (e.g. <tt>/Applications/NeoOffice.app/Contents/MacOS/soffice-nodefault</tt>) and set as the CFBundleExecutable will start NeoOffice without the default Writer document. This follows the format used by the existing '''swriter''', '''scalc''', etc., scripts within NeoOffice.
====References==== ====References====

Revision as of 05:37, 5 October 2008

There are several methods which allow you to launch NeoOffice into a particular application rather than into Writer.

Contents

Launch Shortcuts

made a template file for each of the components that make up NeoOffice and OpenOffice.org. By selecting the template, you'll launch NeoOffice into that component (provided NeoOffice is default application for those filetypes; if not, just make NeoOffice the default for each of these files). You can stick them in your Dock for one-click launching of the desired component. To take up less space on your Dock, put these templates in a folder, and place the folder on the Dock. Click and hold on the folder and you can choose the component you want.

The files can be found here:

http://neo-downloads.sixthcrusade.com/neoofficeshortcuts_en.zip

http://neo-downloads.sixthcrusade.com/neoofficeshortcuts_de.zip

This is especially helpful for NeoOffice 1.2 and above, which open to a blank Writer document.

You can also create your own template that has all of your normal document settings and use that file in the same manner as these launch shortcuts. See Editing Default Styles and Using Templates.

More information:

http://trinity.neooffice.org/modules.php?name=Forums&file=viewtopic&t=445

Stub Applications

You can also download a set of stub applications for each of the different components from http://www.toonetown.com/projects/downloads/NeoOfficeApps.zip. These stubs only work with the 2.0+ releases of NeoOffice for PPC.

Once unzipped, you need to place the applications from the NeoOfficeApps folder inside your /Applications folder (or wherever NeoOffice is installed).

You can then use those applications as if they were stand-alone applications (put them in the Dock, drop files onto them, etc.).

They use the OpenOffice.org icon set because corresponding icons for NeoOffice do not exist.

N.B. There are some limitations to what the stub applications can do; see the discussion in this and following posts on trinity.

Macros

NeoOffice macro and database wizard fabrizio offered the following macro to launch NeoOffice into a particular application.

You can easily change which application is loaded on launch with a macro. For example my NeoOffice 1.2 starts opening the database forms using this macro:

sub apri_documento
dim oFrame as object
dim Doc as Object
dim Url as String
oFrame = ThisComponent.getCurrentController().getFrame()
dim leggo(0) as New com.sun.star.beans.PropertyValue

url="file:///Users/fabrizio/Desktop/Archivio/form database/eventi.sdw"

leggo(0).Name="ReadOnly"
leggo(0).Value=TRUE
Doc = oFrame.loadComponentFromUrl(Url, "", 2, leggo())

end sub

You can change the macro, and after you have everything configured, choose Customize (Configure in NeoOffice 1.2) from the Tools menu; then go to the "Events" tab and link the macro to the "Start Application" event.

References

Thread on trinity discussing this macro.

CFBundleExecutable

It is also possible to define a custom executable in order to start NeoOffice in another component or to pass command line startup flags to NeoOffice.

Simply create a small shell script, save it inside your NeoOffice.app/Contents/MacOS folder, and edit the entry for CFBundleExecutable in NeoOffice's Info.plist to point to your new script. Then move NeoOffice to a new folder and then move it back to /Applications (this forces LaunchServices to update its cached copy of NeoOffice's Info.plist).

N.B. Any patch which changes Info.plist will overwrite your new choice of CFBundleExecutable, as will any new version of NeoOffice, so you will need to repeat these steps afterwards.

Sample shell script

#!/bin/sh

cmd=`dirname "$0"`/soffice.bin
exec "$cmd" -nodefault "$@"

This script, when saved as an executable file (e.g. /Applications/NeoOffice.app/Contents/MacOS/soffice-nodefault) and set as the CFBundleExecutable will start NeoOffice without the default Writer document. This follows the format used by the existing swriter, scalc, etc., scripts within NeoOffice.

References

This trinity thread discusses changing the CFBundleExecutable.

Launcher Applications

A launcher application is under development here.

NOMu

NOMu is a third-party menu item that will launch NeoOffice into the selected component (as well as provide access to recent documents and other functions).


This article in other languages:
Personal tools