A recent feature I really like of EF is the ability to display skim notes. I’m now using this a lot when reviewing papers.
My current workflow is:
if the paper is a .pdf, convert it to a .pdfd (pdf bundle) format
import the .pdfd into EF, remove the .pdf from EF
add notes using skim, they will now show in EF
I would like to easily convert a .pdf to .pdfd inside EF, without having to import the file again (as its name changed). Could it be considered as a feature request? (I guess a workaround could be an applescript…)
Great, thanks a lot. It almost works perfectly, the only caveat being the new file name. For instance, if I start with file name
Detail RIBs.pdf
the resulting file name is now
EFPDFToPDFD.GKqeado0Detail RIBs.p.pdfd
The first bug is in the computing of the base name. I experimented a bit and it seems that
set _base to characters 1 thru -_extensionLength of _name
will return the whole string if _extensionLength is “1”, so you need to add 1 to the length, and include the “.” in the extension (or don’t add it at the end). Here is the new method:
on pdfdNameForRecord(_record)
tell application "EagleFiler"
set _name to _record's filename
if _name ends with ".pdf" then
set _extensionLength to ((length of ".pdf") + 1)
set _base to characters 1 thru -_extensionLength of _name
else
set _base to _name
end if
return _base & ".pdfd"
end tell
end pdfdNameForRecord
For the second small bug (remove the temp prefix), I don’t know how to do it. Is there a way to specify the file name when importing, or to change it after it’s imported?
Oh, and a small suggestion: the copyMetadata seems a very useful function. Maybe you could make it available in EF’s AppleScript dictionary (if such a thing is possible).
Yes, that’s something I’d like to do. This would allow it to copy the formatting for the notes; right now, it only copies the notes as plain text, since that’s what AppleScript works with.
You may notice that the copyMetadata function is a little different in the various scripts I’ve posted. The scripts don’t all want quite the same thing. So the AppleScript command would probably need some options for choosing what to copy (or not copy).
Works great, thanks. I have one final question: why does the record has a URL after the script? (The URL is a file://localhost one that points to the file, except it ends in .pdf.)
Guess: you don’t display the URL if it points to the current file, but as you copy it from the .pdf file, it’s different from the current file, so it’s displayed.
It really does not matter, and it actually highlights what you were saying about which metadata needs to be copied.
Is it an easy mod to have the script assign the Date Added of the pdf to the pdfd? For those who sort by date added, that would retain the item’s place in the record list.