Welcome to NeoOffice developer notes and announcements
NeoOffice
Developer notes and announcements
 
 

This website is an archive and is no longer active
NeoOffice announcements have moved to the NeoOffice News website


Support
· Forums
· NeoOffice Support
· NeoWiki


Announcements
· Twitter @NeoOffice


Downloads
· Download NeoOffice


  
NeoOffice :: View topic - Is it possible to start the spreadsheet portion of NeoOffice
Is it possible to start the spreadsheet portion of NeoOffice
 
   NeoOffice Forum Index -> NeoOffice Releases
View previous topic :: View next topic  
Author Message
DEinspanjer
Red Pill


Joined: Jul 04, 2009
Posts: 9
Location: Salem, NH

PostPosted: Sat Jul 04, 2009 2:18 pm    Post subject: Is it possible to start the spreadsheet portion of NeoOffice

Whenever I need to create a new spreadsheet, I will do the following as demonstrated in the linked screencast:
1. Use Spotlight to open NeoOffice
2. Click the NeoOffice menu item
3. Change to Spreadsheet
4. Close the Text Document editor
http://screencast.com/t/8mMBZNek4

I'm wondering if there might be a way to create new spotlight entries like "NeoOffice - Spreadsheet" or change some preference such that it starts up by default because I use the spreadsheet much more than the text document editor.

Thanks for any ideas you might have.

-Daniel
Back to top
yoxi
Cipher


Joined: Sep 07, 2004
Posts: 1799
Location: Dawlish, Devon

PostPosted: Sat Jul 04, 2009 2:55 pm    Post subject:

Hi Daniel -

This page in the NeoWiki:

http://neowiki.neooffice.org/index.php/NeoOffice_Launch_Shortcuts

explains the several options for starting NeoOffice in the module of your choice.

- padmavyuha
Back to top
DEinspanjer
Red Pill


Joined: Jul 04, 2009
Posts: 9
Location: Salem, NH

PostPosted: Sat Jul 04, 2009 8:48 pm    Post subject: An alternate way to configure default arguments

Thank you yoxi for pointing me at the docs. I spent a little time familarizing myself with the system and came up with the following alternative that I wanted to share with everyone.

Attached is a script similar to the ones currently found in the MacOS folder within the NeoOffice bundle. The difference with this script is that it can pick up the arguments to pass to NeoOffice from the application preferences through the use of the "defaults" Mac OS X utility.

I made a screencast to show it's installation, configuration, and use. Hope it helps someone:
http://www.screencast.com/t/tJf9lxerqH
Back to top
yoxi
Cipher


Joined: Sep 07, 2004
Posts: 1799
Location: Dawlish, Devon

PostPosted: Sat Jul 04, 2009 11:51 pm    Post subject:

Thanks, that's another neat little solution for the tech-savvy - the only disadvantage I can see being (as with the other shell script options) that the user will have to reapply the solution after each main NeoOffice update (and quite likely after some patch updates, if they update the Info.plist file).

- padmavyuha
Back to top
DEinspanjer
Red Pill


Joined: Jul 04, 2009
Posts: 9
Location: Salem, NH

PostPosted: Sun Jul 05, 2009 12:00 am    Post subject:

yoxi wrote:
Thanks, that's another neat little solution for the tech-savvy - the only disadvantage I can see being (as with the other shell script options) that the user will have to reapply the solution after each main NeoOffice update (and quite likely after some patch updates, if they update the Info.plist file).


I agree it is a big disadvantage and that is why I hope the NeoOffice developers might consider making this script (or one based on it) the default CFBundleExecutable. If they did, then NeoOffice would continue to work as it does today for the normal user, but the occasional user like myself wishing to customize it to start calc by default or to not have it open an empty text document would have to do nothing more than to open up a terminal prompt and type:
Code:
defaults write -app NeoOffice DefaultExecutableArgs -calc

or
Code:
defaults write -app NeoOffice DefaultExecutableArgs -nodefault


And it would instantly work the way they wish.

It would also open up the path to future enhancements such as a panel on the preferences dialog to configure what application to launch by default. All the preferences dialog would have to do to persist the user's selection is just write the appropriate DefaultExecutableArgs value.
Back to top
yoxi
Cipher


Joined: Sep 07, 2004
Posts: 1799
Location: Dawlish, Devon

PostPosted: Sun Jul 05, 2009 12:31 am    Post subject:

I was wondering about a PrefPane myself after looking at your script - that's a good plan, let's see what they say... do you know whether the script behaves the same way in all the OSX versions NeoOffice supports? (10.4/10.5/10.6)
Back to top
DEinspanjer
Red Pill


Joined: Jul 04, 2009
Posts: 9
Location: Salem, NH

PostPosted: Sun Jul 05, 2009 12:44 am    Post subject:

I can't say with certainty since I don't have a 10.4 or 10.6 box available to test, but I would definately expect it to. The defaults program has been around since 2003, and the bash syntax used is bash 3 compatible. I suppose with a little work, it could be rewritten as an sh script, but I figured since bash is the default interpreter on OS X it was the right target.
Back to top
sardisson
Town Crier
Town Crier


Joined: Feb 01, 2004
Posts: 4588

PostPosted: Sun Jul 05, 2009 11:52 am    Post subject:

Speaking only for myself, this sounds like a really good solution, and the first one, I think, that has kept in mind the current behavior and the need to preserve that if it were to become the default launch script.

Other things I like:

* It doesn't modify any OOo files, only Neo's Info.plist (one less patch to track)
* User defaults (which we already use other places, e.g. disabling gestures or the remote control) allow you to easily set an all-the-time default for yourself, without touching the binary at all (survives across patch updates)
* Supports command-line arguments for one-time use--which also allows others to write additional script-apps to stand in for separate component applications, which many users also want.

Unfortunately, we can't really add any items to NeoOffice's preferences (hacking the OOo prefs system is a nightmare, I understand, even before you have to worry about the 70-some locales), but "defaults write" is simple enough, and it's almost as simple to write an AppleScript "chooser" for people who'd want to change the component but are deathly afraid of the Terminal.

I don't know enough about how the launch sequence works to know if there are any gotchas we're not considering, though (opening files on the command line or via 'open'?), and, sadly, I don't know if Patrick's schedule will allow him to investigate. Sad

Thanks for putting this together, Daniel!

Smokey

_________________
"[...] whether the duck drinks hot chocolate or coffee is irrelevant." -- ovvldc and sardisson in the NeoWiki
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Sun Jul 05, 2009 12:20 pm    Post subject:

DEinspanjer wrote:
I can't say with certainty since I don't have a 10.4 or 10.6 box available to test, but I would definately expect it to. The defaults program has been around since 2003, and the bash syntax used is bash 3 compatible. I suppose with a little work, it could be rewritten as an sh script, but I figured since bash is the default interpreter on OS X it was the right target.


I really like this idea as it is simple. Also, I don't even need a shell script nor will you need to fuss with the Info.plist. Reading a CFPreference (that is what the "defaults" command creates) is pretty trivial in the C code that we have so I was thinking that I would just add reading the proposed "DefaultExecutableArgs" CFPreference in NeoOffice's main() function.

Our main() function is already heavily customizeed to set the necessary environment variables for proper library loading so reading that CFPreference and tacking it onto any existing arguments should be pretty trivial.

I'll try to get a test patch out in the next day or two that has this change.

Patrick
Back to top
DEinspanjer
Red Pill


Joined: Jul 04, 2009
Posts: 9
Location: Salem, NH

PostPosted: Sun Jul 05, 2009 12:22 pm    Post subject:

Since there was interest, I did a bit more digging around on what exactly the psn argument is, and it turns out it might be important depending on how NeoOffice is written. It is the "process serial number", described here: http://forums.macrumors.com/archive/index.php/t-69397/t-207344.html

So I modified the shell script to properly pass it along. Revised file is attached.
Back to top
DEinspanjer
Red Pill


Joined: Jul 04, 2009
Posts: 9
Location: Salem, NH

PostPosted: Sun Jul 05, 2009 12:25 pm    Post subject:

pluby wrote:
I really like this idea as it is simple. Also, I don't even need a shell script nor will you need to fuss with the Info.plist. Reading a CFPreference (that is what the "defaults" command creates) is pretty trivial in the C code that we have so I was thinking that I would just add reading the proposed "DefaultExecutableArgs" CFPreference in NeoOffice's main() function.

Our main() function is already heavily customizeed to set the necessary environment variables for proper library loading so reading that CFPreference and tacking it onto any existing arguments should be pretty trivial.

I'll try to get a test patch out in the next day or two that has this change.


That sounds great, I'm glad you found the idea useful. Don't forget to have some logic to determine if the user is trying to pass in their own arguments so you can avoid using the defaults in that case.
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Sun Jul 05, 2009 12:29 pm    Post subject:

DEinspanjer wrote:
Since there was interest, I did a bit more digging around on what exactly the psn argument is, and it turns out it might be important depending on how NeoOffice is written. It is the "process serial number", described here: http://forums.macrumors.com/archive/index.php/t-69397/t-207344.html


We already have code to treat the psn argument as it is a special Mac OS X argument. So, what I was planning on doing is to take arguments in the DefaultExecutableArgs CFPreference and append them onto any existing arguments that the soffice.bin executable was started with.

Patrick
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Sun Jul 05, 2009 12:35 pm    Post subject:

pluby wrote:
We already have code to treat the psn argument as it is a special Mac OS X argument. So, what I was planning on doing is to take arguments in the DefaultExecutableArgs CFPreference and append them onto any existing arguments that the soffice.bin executable was started with.


Now that I think about it, I probably should ignore the arguments in the DefaultExecutableArgs CFPreference if there are already arguments other than the psn argument. My thinking is that if there are such arguments (and this would happen if you have already modified Info.plist or are executing NeoOffice from a Terminal), appending the DefaultExecutableArgs may cause conflicting args and NeoOffice may fail to launch.

Let me know if this approach sounds reasonable. If so, I will proceed with implementation.

Patrick
Back to top
DEinspanjer
Red Pill


Joined: Jul 04, 2009
Posts: 9
Location: Salem, NH

PostPosted: Sun Jul 05, 2009 12:39 pm    Post subject:

pluby wrote:
Let me know if this approach sounds reasonable. If so, I will proceed with implementation.


Exactly what I was in the process of typing. :) That is why my script logic says if there are 0 arguments or just the -psn argument then use the defaults, else ignore them.

I think this is the safest logic to implement. It does leave a small feature hole where a user might want to specify some default arguments and then build on to them from the command line, but honestly, that is pretty out there and providing the users with this feature as is should make the "tweakers" very happy.
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Mon Jul 06, 2009 10:12 am    Post subject:

I think that I have implemented this new feature. Can you install the following test patch and tell us if it works for you?

With the following test patch, you can set a single default launch option using the following Terminal command. For example, to start in Calc by default, use the following command:

Code:
defaults write org.neooffice.NeoOffice DefaultLaunchOptions -calc


You can replace "-calc" with the following options:

Code:
-draw
will open a new Draw document
Code:
-impress
will open a new Impress document
Code:
-math
will open a new Formula document
Code:
-nodefault
will not open any document

For users who want to specify more than one launch option, you can specify a list of options using the following terminal command. For example, to launch NeoOffice and have it open "file1.odt" and "file2.ods" from your Desktop, use the following command:

Code:
defaults write org.neooffice.NeoOffice DefaultLaunchOptions -array \ ~/Desktop/file1.odt ~/Desktop/file2.ods


Intel:
http://joe.neooffice.org/test/NeoOffice-3.0-Patch-5-Test-3-Intel.dmg
http://joe.neooffice.org/test/NeoOffice-2.2.5-Patch-13-Test-3-Intel.dmg

PowerPC:
http://joe.neooffice.org/test/NeoOffice-3.0-Patch-5-Test-3-PowerPC.dmg
http://joe.neooffice.org/test/NeoOffice-2.2.5-Patch-13-Test-3-PowerPC.dmg

Patrick
Back to top
Display posts from previous:   
   NeoOffice Forum Index -> NeoOffice Releases All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © Planamesa Inc.
NeoOffice is a registered trademark of Planamesa Inc. and may not be used without permission.
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.