Skip to content

Instantly share code, notes, and snippets.

@mikheyev
Forked from drobbins/readme.md
Created April 27, 2014 07:42
Show Gist options
  • Save mikheyev/11339817 to your computer and use it in GitHub Desktop.
Save mikheyev/11339817 to your computer and use it in GitHub Desktop.

Papers2 Library Cleanup

For a variety of reasons, my Papers2 library folder (~/Library/Application Support/Papers2) was cluttered with many duplicate papers, generally only one of which was linked to a document in Papers2. Here is how I cleaned it up.

  1. From a Terminal, cd ~/Library/Application\ Support.
  2. open .
  3. Copy the Papers2 folder to the Desktop. This is your backup.
  4. In Papers2, cmd+,, select Library, select Add next to "Rename files in library folder as:", and select Separator -> _ then click Apply.
  5. Back in your Terminal, find ./ -iregex ".*[^_]\.pdf" -delete
    • If you want to see what's going to be deleted before doing it, run find ./ -iregex ".*[^_]\.pdf"
  6. Back in Papers2, remove the _ from "Rename files in library folder as:", and click Apply again.

And thats it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment