On 7 Mar 2009, at 6:19 PM, Jonas Zimmermann wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> just a question about templates. I've only now looked at them after
> the discussion of the previous days. First, the documentation of the
> template keys seems a bit inconsistent: localURL may be deprecated,
> but it's localFiles that should be used instead.

That's a typo, thanks for the note.

> But that's just
> minor. I wanted to get a link to the file with abbreviated path (just
> as in the standard template), but using the linkedText key instead.
> However, while the key itself works, it doesn't take any modifiers
> (output is blank).

I think you misunderstand linkedText: it gives an attributed string  
with a link attribute to link to the URL or file, useful for rich text  
templates. As it is an attributed string, it won't take string  
modifiers.

> I can modify the absoluteString key, however, that
> also doesn't give a tilde-abbreviated path.

absoluteString is the URL string, and  
stringByAbbreviatingWithTildeInPath expects a path.

> Is there something I miss about using keys and modifiers, or is it a
> bug?
> My template portion would look like this:
> <$localfil...@nonempty>
> <$linkedText.stringByAbbreviatingWithTildeInPath/>
> <$absoluteString/>
> <$richTextSkimNotes?>
> Notes:
> <$richTextSkimNotes/>
> </$richTextSkimNotes?>
> </$localfil...@nonempty>
>
> Best,
> JOnas
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.10 (Darwin)


What you miss is that you need to get path instead of linkedText. If  
you still want a link, you should add linkedText at the end. < 
$path.stringByAbbreviatingWithTildeInPath.linkedText/>

Also, linkedFiles are /linked file/ objects, not paths or URLs. BD  
applies a trick to make keys like absoluteString and richTextSkimNotes  
work, but it's more correct to add a url key in the path. However  
@nonEmpty won't work, because linked files are never 'empty' (the url  
or path can be 'empty'). So either add a condition tag, or perhaps  
better use the following (which also addresses the above comment):

<$localfiles.u...@nonempty>
<$path.stringByAbbreviatingWithTildeInPath.linkedText/>
<$absoluteString/>
<$richTextSkimNotes?>
Notes:
<$richTextSkimNotes/>
</$richTextSkimNotes?>
</$localfiles.u...@nonempty>


>

Christiaan


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Bibdesk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Reply via email to