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

Download or installation problems? Try these steps
Problems after upgrading to NeoOffice 2022? Try these steps


Support
· NeoOffice Support
· NeoWiki


Announcements
· Twitter @NeoOffice


Downloads
· Download NeoOffice


RSS Feeds
· Announcements Only
· All Posts


  
NeoOffice :: View topic - Opening text files in Calc - NeoOffice TSV Helper updated!
Opening text files in Calc - NeoOffice TSV Helper updated!
 
Post new topic   Reply to topic    NeoOffice Forum Index -> NeoOffice Releases
View previous topic :: View next topic  
Author Message
sardisson
Town Crier
Town Crier


Joined: Feb 01, 2004
Posts: 4588

PostPosted: Sun Jan 10, 2010 2:20 pm    Post subject: Opening text files in Calc - NeoOffice TSV Helper updated! Reply with quote

In the past I've mentioned my NeoOffice TSV Helper app/sample code in a number of threads, and rather than spam all of them with an update announcement, I'm going to create a topic for the update and fill it with some useful search terms Wink

Do you have .tsv (tab separated values) files or other text-based, delimited files that you want to open in Calc without renaming them to have a .csv extension? NeoOffice TSV Helper can help.

NeoOffice TSV Helper is a small AppleScript applet that passes files directly to Calc to prevent NeoOffice's underlying OpenOffice.org code from opening them in Writer. Any file you drag onto the Neo TSV Helper icon (or select from the "Open File" dialogue if you double-click the app) will open in Calc.

For files with the .tsv extension, you can use the Finder's "Open With" context menu item to open the files, and you can also set Neo TSV Helper as the default application in the Finder (by performing Get Info on one or more files and changing the application in the "Open with:" section), so that you can double-click those files and have them open in Calc.

If you have files with other extensions and you'd like to be able to double-click them to open in Calc (rather than dragging them to the Neo TSV Helper icon each time), you can edit Neo TSV Helper's Info.plist file to add additional extensions to the "CFBundleTypeExtensions" key. (This is easiest to do with Property List Editor, part of Apple's developer tools, but can be done with any text editor.)

NeoOffice TSV Helper is available from http://www.ardisson.org/smokey/mac/#neo-tsv

2011-12-12 (v1.1.2) - Updated the UTI declaration in the Info.plist file to prevent declaring the tab separated values UTI for all files with an OS type code of TEXT.

2011-12-11 (v1.1.1) - Updated the Info.plist file to declare a Uniform Type Identifier (UTI), for better compatibility with Spotlight and Quick Look. Fixed some typographical errors in the Readme.

Version 1.1 (2010-01-10) fixes a couple of small bugs and no longer tries to open a nonexistent document when run.

Smokey

_________________
"[...] whether the duck drinks hot chocolate or coffee is irrelevant." -- ovvldc and sardisson in the NeoWiki


Last edited by sardisson on Mon Dec 12, 2011 2:05 pm; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11932

PostPosted: Sun Jan 10, 2010 3:03 pm    Post subject: Reply with quote

I am interested in looking at the source code but I cannot open the droplet in the ScriptEditor application. Is there any trick to opening this file or is the source somewhere else?

Patrick
Back to top
View user's profile Send private message Visit poster's website
sardisson
Town Crier
Town Crier


Joined: Feb 01, 2004
Posts: 4588

PostPosted: Sun Jan 10, 2010 3:59 pm    Post subject: Reply with quote

pluby wrote:
I am interested in looking at the source code but I cannot open the droplet in the ScriptEditor application. Is there any trick to opening this file or is the source somewhere else?

Just click "OK" when Script Editor claims it can't open the app because there's no dictionary, blah, blah, blah (that message comes up as an consequence of some things that must be added to the Info.plist to make the applet more app-like to be selectable as a default app in the Finder, etc) and Script Editor should open it just fine.

If for some reason that doesn't work, you should be able to open the "NeoOffice TSV Helper.app/Contents/Resources/Scripts/main.scpt" file directly in Script Editor.

If for some reason *that* still doesn't work, let me know and I'll post the raw script separately; I've not done anything to make it so people can't view the code. Sad

It's really old code so I want to rewrite it at some point, but someone reported a really sad bug yesterday that needed a quick fix, so the 2010 changes are just a couple minor fixes and not the needed rewrite.

Smokey

_________________
"[...] whether the duck drinks hot chocolate or coffee is irrelevant." -- ovvldc and sardisson in the NeoWiki
Back to top
View user's profile Send private message Visit poster's website
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11932

PostPosted: Sun Jan 10, 2010 4:05 pm    Post subject: Reply with quote

sardisson wrote:
It's really old code so I want to rewrite it at some point, but someone reported a really sad bug yesterday that needed a quick fix, so the 2010 changes are just a couple minor fixes and not the needed rewrite.


I wsa thinking that adding an "open .csv and .tsv in Calc by default" feature might be something we could post in the New Feature Requests forum. I figured that your code might give me some ideas as to how to force NeoOffice's underlying OpenOffice.org code to use Calc instead of Writer for these file types.

Patrick
Back to top
View user's profile Send private message Visit poster's website
sardisson
Town Crier
Town Crier


Joined: Feb 01, 2004
Posts: 4588

PostPosted: Sun Jan 10, 2010 5:26 pm    Post subject: Reply with quote

:sigh: And somehow the wrong file was there Sad If you've downloaded today, please redownload (you may have to use a different browser or wait until the downloaded file expires from your browser's cache).

Smokey

_________________
"[...] whether the duck drinks hot chocolate or coffee is irrelevant." -- ovvldc and sardisson in the NeoWiki
Back to top
View user's profile Send private message Visit poster's website
sardisson
Town Crier
Town Crier


Joined: Feb 01, 2004
Posts: 4588

PostPosted: Sun Dec 11, 2011 11:10 pm    Post subject: Reply with quote

I've just updated NeoOffice TSV Helper to version 1.1.1, which adds some UTI declarations to the plist, so that files "owned" by NeoOffice TSV Helper will be compatible with any Spotlight importers or Quick Look generators that claim to handle the "public.tab-separated-values-text" UTI. (I've defined this UTI to inherit from "public.comma-separated-values-text" and "public.text", so if you have no importer/generator that handles "public.tab-separated-values-text", then whatever handles regular text will handle them.)

If you have existing .tsv files, Spotlight won't immediately update the kMDItemContentType field from whatever dynamic content type it was using; I've found that simply renaming "foo.tsv" to "foo.txt" and then back to "foo.tsv" will cause Spotlight to update the file to have to the correct content type.

Same link as in the top of the thread.

Smokey

_________________
"[...] whether the duck drinks hot chocolate or coffee is irrelevant." -- ovvldc and sardisson in the NeoWiki
Back to top
View user's profile Send private message Visit poster's website
sardisson
Town Crier
Town Crier


Joined: Feb 01, 2004
Posts: 4588

PostPosted: Mon Dec 12, 2011 2:02 pm    Post subject: Reply with quote

The old adage about letting things sit overnight and checking again in the morning (or the one about never releasing something when you're tired) has just been proven true again Razz

I noticed today that some of my files with the old OS type code of TEXT were suddenly being Quick Looked by the CVS generator I linked to in my previous post (and were being reported by Spotlight as having TSV UTIs), rather than being handled by the OS-provided plain-text generator. In my haste last night, I didn't think clearly enough when defining what file types the TSV UTI should apply to, and accidentally included the old OS type code of TEXT in addition to the file extension .tsv and the TSV mime type. Sad

If you've downloaded version 1.1.1, please replace it with version 1.1.2 (same link above); I apologize for the inconvenience.

Smokey

_________________
"[...] whether the duck drinks hot chocolate or coffee is irrelevant." -- ovvldc and sardisson in the NeoWiki
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    NeoOffice Forum Index -> NeoOffice Releases All times are GMT - 7 Hours
Page 1 of 1

 
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.
Page Generation: 0.03 Seconds