An Applescript to automatically create PDFs of your AnyList Recipes
AnyList is a great app/website for creating shopping lists and managing recipes.
Unfortunately, it does not have a way to backup or bulk export recipes. This makes it difficult to (A) backup recipes and (B) share them with others. You can email or print/pdf individual recipes, but that's not great if you want to backup or share more than a few at a time.
I briefly looked into parsing the data directly from the server, but it's some kind of protobuf format that I don't feel like spending the effort to reverse engineer; and then have to figure out how to reformat nicely. Instead, we can just script printing each recipe to a PDF using AppleScript!
This is still pretty rough around the edges, but I'm hoping to make improvements over time. Make sure to follow the steps below carefully each time.
Apple has changed the GUI layouts a bit in some releases of OS X, so I've had to update the AppleScript accordingly. To make it easier to maintain, I'm not going to make it support multiple versions (I also don't have a great way to test older versions anyway). So if you need an older version, you can check out the revisions listed below. That said, you also won't get other improvements by going back. I'm not sure how far back it will work either.
- Mac OS X Ventura (13): master
- Mac OS X Big Sur (11) - Monterey (12): f340ee38b44d3fefea24434acf8f2bf2d7fd54f1
- Mac OS X ??? - Catalina (10.15): a2f9e5e94900ad2e5ca53c406a45785419afabf1
- Requires Safari to allow javascript from Apple Events, but you might want to turn it off when done for security
- See this page for details
- Go to https://anylist.com/web in Safari and login
- Click "View All Recipes" on the "Recipes" page
- If you want to print a subset of recipes, feel free to select a different collection
- Select the first recipe in the list
- Set print directory and other print settings (if you did this last time, then it's not necessary to set again - it should remember)
- Press cmd+p to open the print dialog
- Configure any print settings you want (e.g. "Print headers and footers", etc)
- Click "PDF" and select "Save as PDF"
- Select a directory
- Cancel out of all dialogs to get back to the Anylist webpage
- Make sure to follow the Setup above
- Open script in Script Editor and run it (play button)
- If you've never run an AppleScript before, you may have to give permissions
- Leave the computer alone while it runs just in case
- Disable javascript from Apple Events in Safari
- See this page for details