Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
kb:exporting_from_endnote_with_pdfs [2010/04/22 06:01] – VBS script: 1/ amended the BrowseForFolder text wording lubos | kb:exporting_from_endnote_with_pdfs [2017/11/22 12:58] (current) – bwiernik | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | === How do I import my EndNote library, complete with attached PDFs? === | + | See [[importing_records_from_endnote|Importing Records |
- | + | ||
- | Obviously, manually adding every PDF from a large EndNote library would be rather labor intensive. There is a trick to automating it, though. | + | |
- | + | ||
- | Zotero' | + | |
- | + | ||
- | You should be able to import all the PDFs by using a single find and replace statement. In EndNote, you need to export your library using the RIS (Refman) style. It should be exported as a text document. | + | |
- | + | ||
- | In it, you will want to replace the ' | + | |
- | + | ||
- | Os OS X and Linux, you may run:< | + | |
- | </ | + | |
- | ' RIS link fixer for windows | + | |
- | ' transforms Endnote internal-pdf:// | + | |
- | + | ||
- | Dim FileName, objDialog, boolResult | + | |
- | Dim regEx, FileContents, | + | |
- | Dim objShell, pdfFolder | + | |
- | + | ||
- | ' | + | |
- | Set objDialog = CreateObject(" | + | |
- | objDialog.Filter = "RIS (*.ris)|*.ris|All Files (*.*)|*.*" | + | |
- | objDialog.FilterIndex = 1 | + | |
- | boolResult = objDialog.ShowOpen | + | |
- | If boolResult = 0 Then | + | |
- | WScript.Quit | + | |
- | Else | + | |
- | FileName = objDialog.FileName | + | |
- | End If | + | |
- | + | ||
- | ' | + | |
- | Set regEx = New RegExp | + | |
- | regEx.Pattern = " | + | |
- | FileContents = GetFile(FileName) | + | |
- | + | ||
- | ' | + | |
- | set objShell = CreateObject(" | + | |
- | set pdfFolder = objShell.BrowseForFolder(0, | + | |
- | If (not pdfFolder is nothing) then | + | |
- | ReplaceWith | + | |
- | If (Right(ReplaceWith, | + | |
- | ReplaceWith = ReplaceWith & " | + | |
- | End If | + | |
- | regEx.Global = True | + | |
- | modFileContents = regEx.replace(FileContents, | + | |
- | If modFileContents <> FileContents Then | + | |
- | WriteFile FileName, modFileContents | + | |
- | Wscript.Echo "The RIS file has successfully been modified." | + | |
- | Else | + | |
- | Wscript.Echo "No EndNote attachments have been detected in the RIS file." | + | |
- | End If | + | |
- | End If | + | |
- | + | ||
- | function GetFile(FileName) | + | |
- | If FileName<>"" | + | |
- | Dim FS, FileStream | + | |
- | Set FS = CreateObject(" | + | |
- | on error resume Next | + | |
- | Set FileStream = FS.OpenTextFile(FileName) | + | |
- | GetFile = FileStream.ReadAll | + | |
- | End If | + | |
- | End Function | + | |
- | + | ||
- | function WriteFile(FileName, | + | |
- | Dim OutStream, FS | + | |
- | on error resume Next | + | |
- | Set FS = CreateObject(" | + | |
- | Set OutStream = FS.OpenTextFile(FileName, | + | |
- | OutStream.Write Contents | + | |
- | End Function | + | |
- | </ | + | |
- | {{tag> | + |