From: Christiaan H. <cmh...@gm...> - 2010-06-12 21:52:44
|
On Jun 12, 2010, at 23:42, Gregory Jefferis wrote: > Hi Adam, > > On 2010-06-12 21:12, "Adam R. Maxwell" <ama...@ma...> wrote: > >> Doesn't +itemByParsingPDFFile: do this now? I just glanced at the code, and >> it seems to try and use the file name as a search term first. >> >> + (id)itemByParsingPDFFile:(NSString *)pdfPath; >> { >> BibItem *bi=nil; >> >> // see if we can find any bibliographic info in the filename >> NSString *pubMedSearch=nil; >> pubMedSearch=[[[pdfPath lastPathComponent] stringByDeletingPathExtension] >> stringByMakingPubmedSearchFromAnyBibliographicIDsInString]; >> if(pubMedSearch!=nil){ >> bi=[BibItem itemWithPubMedSearchTerm:pubMedSearch]; >> if(bi!=nil) return bi; >> } > > StringByMakingPubmedSearchFromAnyBibliographicIDsInString will only look for > dois and Elsevier/NPG PIIs which are MUCH more specific than PMIDs (which > are just an 8 digit number). > > Greg. > I remember now. The problem is that there's absolutely no reason to think that just some arbitrary number should be interpreted as a PMID. For instance, the arXiv also uses numbers for PDF file names. So using an Import script hook would be the way to go. Christiaan |