OSX:Changing the “Web Receipts” Folder

April 14, 2008 | 8 Comments

One of my favorite features in Leopard is the “Save to Web Receipts”. Judging by the posts on the web I’m not sure whether this is a new feature or not. Either way, I really like it… except… Saving important web pages (receipts, confirmations, reservations, etc) is something I’ve been doing for a long time now without this feature, it was just a pain. In fact I did it on Windows for years before even switching to Mac, except all by hand. The function in OSX saves me the trouble of naming the file and choosing the directory which is great, except I don’t like the way it does either.

The first problem is that in general the date of the receipt is the most importat sorting factor, and having it in the “date modified” column is mildly dangerous, like if I make changes or notes on it for example. The second problem is at work when I’m saving receipts it doesn’t help me get them to the unified receipts folder at home.

I decided to solve both problems today and luck you, I’ll share. Reading the web the way this was implemented changed at some point. It used to be an Automator script but apparently that was rather limiting (which is pretty bad if you’re Apple and your own Automator doesn’t cut it). So they re-implemented in Python. This is a shame because having opened up Automator for the first time it looks really cool and relatively user friendly, unlike what you’re about to repeat below.

  1. In Finder, go to /Library/PDF Services/
  2. Duplicate the “Save PDF to Web Receipts Folder” and rename it to something else but keep the .pdfworkflow extension, in my case, “Save to DropBox Receipts.pdfworkflow”
  3. Right-click and select “Show Package Contents”
  4. Naviage into the “Contents” folder
  5. Delete the “Resources” folder
  6. Open “Info.plist” in a text editor and rename the “CFBundleName” string to something helpful, probably something that strongly resembles the filename you created in Step 2, then save and close that file
  7. Open the “tool” file in a text editor
  8. If you want to change the target folder:
    1. around line 24 you’ll see something the line that sets the value of destDirectory to “~/Documents/Web Receipts/”, change that.
  9. If you want to add a date at the beginning of the filename
    1. at the top of the file (around like 9) insert a new line with:
      from datetime import date
    2. around the previously mentioned line 24 add:
      title = "%s - %s" % (date.today(), title)
  10. Save and exit

That will end up giving you filed names like “2008-04-13 – American Express Online.pdf” saved in the directory of you’re choosing. To test just go to any app, bring up the print dialog and confirm that your new entry shows up. Also, if you have any problems, just trash the duplicate you created and edited.

EDIT (2008/08/26) – Fixed the missing close parenthesis at the end of item 9.2 pointed out by James. Thanks!


8 Comments

  1. HI thanks for this. All goes well until I try to implement the addition of date to the pdf is this correct:
    import os
    import shutil
    import sys
    from datetime import date
    def safeFilename(filename):
    filename = filename.lstrip(‘.’)
    filename = filename.replace(os.path.sep, ‘-’)
    if len(filename) == 0:
    filename = “Untitled”
    elif len(filename) > 245:
    filename = filename[0:245]
    return filename

    def main(argv):

    (title, options, pdfFile) = argv[0:3]
    title = “%s – %s” % (date.today(), title
    destDirectory = os.path.expanduser(“~/Archive/Receipts/”)

    Comment by James — August 17, 2008 #


  2. Thanks for the tip!
    Is there a way the date could be without the dashes (20080914) ?

    Comment by Yves — September 14, 2008 #


  3. Sure. Here are the two changes.
    1) add “import datetime” (this can replace the previous “from
    datetime import date”)
    2) replace “date.today()” with:
    “datetime.datetime.now().strftime(“%Y%m%d”)”

    Resulting in:
    title = “%s – %s” % (datetime.datetime.now().strftime(“%Y%m%d”), title)

    You can also compose other arbitrary date formats with this method.

    Comment by pablo — September 14, 2008 #


  4. [...] OSX: Changing the “Web Receipts” Folder [...]

    Pingback by OSX: Changing the “Web Receipts” Folder — January 6, 2009 #


  5. Thanks!! This worked perfectly in my Snow Leopard MBP.

    Comment by Jason — March 1, 2010 #


  6. Awesome tip. Very clear instructions. Worked perfectly.

    Comment by Jordachio — December 8, 2010 #


  7. Hi this was great help… however, I am using a non-English language version and I thought I just point out, that the only difference to the above instructions is NOT to delete the Resources folder, and instead go in there, find the language(s) you’re using, and change the CFBundleName (item 6) to your localized version(s).

    Maybe you can do that without the Resources folder, but will it work with extended character-sets?

    Comment by Anders — April 5, 2011 #


  8. [...] based on Pablo Averbuj’s original tutorial. Follow @macgasm !function(d,s,id){var [...]

    Pingback by Move your Web Reciepts folder to Dropbox or iDisk | Macgasm — April 1, 2013 #

Sorry, the comment form is closed at this time.