On Jan 18, 2010, at 10:43, Fischlin Andreas wrote:
> Dear Christiaan,
>
> The purpose is to readd links of any orphaned pdf's for the currently
> selected publications. You notice these orphaned pdf's either by the red
> clip, the question mark in the side pane or via AppleScript if missing value
> is returned for a linked file. However, my algorithm also finds pdf's that
> were never linked (for whatever reason), such as added supplementary material
> for the same publication, given that pdf is stored at the correct place and
> matches the naming rules. Then it will also be added.
>
Yes, that's how I understood that. So it's also what I'm talking about.
> With gaps I was only referring to our cite key rule that requires
> monotonously increasing numbers being added after the first two characters
> from the first author and you're right, this has actually nothing to do in
> this context.
Again, I'm not talking about BibDesk to figure out the extra index (through %n
or something), that wouldn't work anyway because BD would try to find an index
for a file that does /not/ exist (i.e. are unique), while you're looking for
indexes for files that /do/ exist. But to hard-code that into the format to use
for a trial-format. So you can use a format "%f{Cite Key}1/%f{Cite Key}_S1.pdf"
for the next trial, etc.
Christiaan
>
>>>> Also, an easy way to get a generated value is to make use of BibDesk's
>>>> format parsing through the "parse format" command, as in 'parse format
>>>> "%f{Cite Key}1/%f{Cite Key}.pdf" for field "dummy" of thePub', or in the
>>>> case of Daniele, 'parse format "%a1/%Y.pdf" for field "dummy" of thePub'.
>>>
>>> AFAIK that would not work, since I can not rely on BibDesks parsing, I need
>>> increasing numbers and not simply a gap for my cite keys. And if several
>>> linked files are used the naming rule goes as this:
>>>
>>> 1) <cite key>.pdf for work itself
>>>
>>> 2) <cite key>_S.pdf for supplementary material
>>>
>>> 3) <cite key>_S2.pdf for more supplementary material
>>>
>>> 4) <cite key>_S3.pdf for more supplementary material
>>> ...
>>> 63) <cite key>_S3.pdf for more supplementary material
>>> User is alerted with warning message
>>>
>>> Regards,
>>> Andreas
>>>
>>
>> I don't see why that means you can't use "parse format", you can just adapt
>> the format for these cases. And I don't understand what you mean by a gap.
>> What "parse format" does is just generate the the relative path based on the
>> cite key, essentially what you're doing with several lines of applescript,
>> nothing more.
>
> If I parse, say like this:
>
> tell application "BibDesk"
> set theTrialPFNPart to parse format "%f{Cite
> Key}1/%f{Cite Key}.pdf" for field "URL" of thePub
> end tell
>
> I do not gain much. Above is equivalent to:
>
> set theTrialPFNPart to theSubFolderCh & dirSep & theCiteKey & ".pdf"
>
> while I have in fact to generate and test for the presence of many more
> orphaned pdf-files according to above list, i.e. cases 1) to 63). Therefore
> parse format rather gets into my way and does not help much. I need to
> generate many absolute paths theTrialPFN's with statemets such as
>
> set theTrialPFN to workDir & fn & "." & ext
> set theTrialPFN to workDir & fn & "_S." & ext
> set theTrialPFN to workDir & fn & "_S" & name_increment & "." & ext
> ...
>
> depending on case in a loop and add links to whatever matches to BibDesk if
> the link is not ok. I really don't see where parse format can help in any
> substantial manner.
>
> BTW, parsing for field "dummy" does fail. I guess I understood you correctly
> that one can not use literally a field "dummy", right?
>
> While explaining this it occurs to me that I could actually speed up this
> algorithm considerably by resorting to shell command 'ls' instead of
> "misusing" AppleScript. E.g. 'ls -1 <citekey>*.pdf' and then simply loop over
> the resulting list to check which links are missing and adding those broken.
>
> Andreas
> ________________________________________________________________________
> ETH Zurich
> Prof. Dr. Andreas Fischlin
> Systems Ecology - Institute of Integrative Biology
> CHN E 21.1
> Universitaetstrasse 16
> 8092 Zurich
> SWITZERLAND
>
> [email protected]
> www.sysecol.ethz.ch
>
> +41 44 633-6090 phone
> +41 44 633-1136 fax
>
> Make it as simple as possible, but distrust it!
> ________________________________________________________________________
> <Fischlin
> Andreas.vcf>------------------------------------------------------------------------------
> Throughout its 18-year history, RSA Conference consistently attracts the
> world's best and brightest in the field, creating opportunities for Conference
> attendees to learn about information security's most important issues through
> interactions with peers, luminaries and emerging and established companies.
> http://p.sf.net/sfu/rsaconf-dev2dev_______________________________________________
> Bibdesk-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bibdesk-users
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Bibdesk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users