On Thu 16 Feb 2012, 18:05:10, Morten Omholt Alver 
<[email protected]> wrote:
> On 16 February 2012 06:32, Pete Crite<[email protected]>  wrote:
>> Hi, is there a way to set a directory as an external file type, so that
>> you can link it to an article? I tried listing MIME type as
>> "inode/directory" in the external file types, which didn't work. I also
>> tried adding a ".folder" suffix to the directory, and defining that in
>> the external file types, but that didn't work either.
>
> Hi,
>
> I've never thought of that. The code handling the links is written
> under the assumption that the links are to files, so I don't suppose
> that would work.
>
>
> Morten

Ok, thanks for that. I guess I could create an archive as a workaround, 
but in one case I have a full html hierarchy, so that wouldn't exactly 
work. Perhaps another option is a symlink, but I couldn't see a clear 
solution that way either.

Anyway, I just made another workaround, using a bash script. N.B. this 
probably won't work for Windows, but is fine for Linux or Mac. Create a 
text file with the name of the folder + ".sh". For example, if the 
pertinent article-specific folder is Smith2012, then call the script 
"Smith2012.sh" (and save it in the "external file links" directory). 
Copy and paste the following four lines into the text file: N.B. for 
Macs substitute "nautilus" with "open".

#!/usr/bin/env bash
# opens the folder with the same name (less .sh) in nautilus
dirpath=`echo "${0}" | sed -r 's/\.sh$//'`
nautilus "${dirpath}"

Make the script executable with the following terminal command 
(substituting the path to your script):
chmod u+x /path/to/the/folder/Smith2012.sh

Now we need to tell Jabref about .sh files, so open Jabref, go to 
Options > Manage external file types, then add a file type with 
extension=sh and application=/bin/bash (you can give it the pretty 
folder icon too!). Now you can auto-link .sh files as normal from within 
Jabref. Opening the file from within Jabref should open the folder in 
nautilus (or Finder for Macs).

N.B. the same script can be used for other references. Just duplicate 
the file, and change the name to reflect the new article + .sh . There 
is no need to modify the script.

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Jabref-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jabref-users

Reply via email to