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 - hyperlink to reveal file in finder?
hyperlink to reveal file in finder?
 
   NeoOffice Forum Index -> NeoOffice Releases
View previous topic :: View next topic  
Author Message
BabaG
Agent


Joined: Feb 06, 2009
Posts: 13

PostPosted: Fri Feb 06, 2009 11:42 pm    Post subject: hyperlink to reveal file in finder?

i'd like to be able to create a hyperlink in a column. the data in the column is filenames. what i'd like to be able to do is to have a filename be clickable such that the click action opens a finder window for the file's location, showing the file highlighted.

is this possible? how would i go about this?

if it's helpful, it wouldn't be a problem to include a column with the path to each file as there are only a couple of places where the files reside.

thanks,
BabaG
Back to top
Markk
Operator


Joined: Mar 15, 2007
Posts: 43
Location: Wisconsin US

PostPosted: Sat Feb 07, 2009 10:51 am    Post subject: Re: hyperlink to reveal file in finder?

BabaG wrote:
i'd like to be able to create a hyperlink in a column. the data in the column is filenames. what i'd like to be able to do is to have a filename be clickable such that the click action opens a finder window for the file's location, showing the file highlighted.

is this possible? how would i go about this?

if it's helpful, it wouldn't be a problem to include a column with the path to each file as there are only a couple of places where the files reside.

thanks,
BabaG


The problem I think is to get the file highlighted. You would need an applescript or something like that to get it to work. Is that OK? No matter what, what you are asking will mean any spreadsheet like this would only work on Mac's and only with only with the directory structure you are imposing. If that is ok then you must add a script that given a fully qualified file name (path included) just opens the finder with that file selected.

You use hyperlinks to do this.

To just get the file to open you do this:
Insert - Hyperlink in the column. Then make sure Document Option is clicked on the left side. Use the Folder button next to the Path field to locate the file you want. and select it. Enter the File Name you want to show in the Text Field. In the spreadsheet now, when you click on the name of the file it will open in whatever app is default for it.

To Open the directory that contains that file, just do the exact same thing as above, but when you have selected the document actually edit the path field so that the document name itself is removed. That will get you the directory in the finder to open when you select the link.

Now to get the finder to have this file selected... Given an applescript (osascript file) that when passed a path and file name opens the finder to that path and selects the file name, you just select this program in the hyperlink with the appropriate parameter of file name and path. I know the finder can be commanded to do this, but the osacript to do so I don't know. The "path" in the hyperlink will look something like

path-to-osa-script-if-necessary/osascript script-name filepath filename

You may be able to omit the path-to-osascript-if-necessary/ part
This will work post 10.4 when they added command line parameters to osascript.

You could actually create an OO macro that does the whole thing also and make that execute when the cell was selected, but you will still need to call OSA script I believe inside that to get the finder to do what you want.

I am having a hard time figuring out why you would want to do this actually.

There are likely other ways also. But I'm not real familiar with them.
Back to top
BabaG
Agent


Joined: Feb 06, 2009
Posts: 13

PostPosted: Sat Feb 07, 2009 11:49 am    Post subject:

just for info, and thanks by the way, this is all very helpful and will get me to the next step, the spreadsheet is a listing of a library of shots taken with a video camera. there are thousands of files. i want to set up a searchable spreadsheet such that clicking on a filename will preview the shot in a player and clicking in another spot will reveal the shot in the library so that it can be dragged into final cut pro.

guess i'm off to figure out apple script for this. something else i know nothing about.

thanks again!
BabaG
Back to top
ovvldc
Captain Naiobi


Joined: Sep 13, 2004
Posts: 2352
Location: Zürich, CH

PostPosted: Sat Feb 07, 2009 12:36 pm    Post subject:

This sounds more like a job for a database...

best wishes,
Oscar

_________________
"What do you think of Western Civilization?"
"I think it would be a good idea!"
- Mohandas Karamchand Gandhi
Back to top
Display posts from previous:   
   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.