CAN I PRINT SAFARI HISTORY for a project

Discussion in 'macOS' started by tanlin, Jun 9, 2006.

  1. tanlin macrumors newbie

    Joined:
    Jun 9, 2006
    #1
    Does anyone know how to print one's history of viewed sites in Safari? Is this possible. I am trying to document every web site I've visited for a year but don't seem to be able to copy the history list for any given day?

    help!
     
  2. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #2
    Unfortunately, in default form, Safari doesn't keep it's history for very long at all. Plus it's stored as a binary XML file, so it's not easy to print out directly, and if you did it wouldn't make much sense.

    However, there seems to be 3rd party apps out there that deal with safari history. Check them out and maybe you can find what you need. Particularly "Saft" I think.

    http://www.macupdate.com/search.php?keywords=safari+history&os=macosx&button.x=0&button.y=0
     
  3. skoker macrumors 68000

    skoker

    Joined:
    Aug 6, 2005
    #3
    I don't know, CAN YOU PRINT SAFARI HISTORY?

    It's an XML file, you can copy it to a text file and then manually remove all of the crap from that if you feel so inclined.
     
  4. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #4
    In Tiger it's a binary XML file, ot a text XML file.
     
  5. mrichmon macrumors 6502a

    Joined:
    Jun 17, 2003
    #5
    Yellow is correct, under tiger the History.plist file is a binary XML file. But the URL and page names can easily be extracted using the following command at the Terminal:

    Code:
    strings ~/Library/Safari/History.plist > ~/Desktop/strings.txt
    
    The command above extracts the text parts of the Safari history from the History.plist file and stores the text in the file "strings.txt" on the Desktop.

    A second version that also trims some of the garbage off is:

    Code:
    strings ~/Library/Safari/History.plist | cut -f 1 -d '[' > ~/Desktop/strings2.txt
    
    This second version trims off some of the garbage resulting from the extraction and produces the file "strings2.txt" on your desktop.

    The resulting strings.txt or strings2.txt file can be imported into your Word processor and edited to suit your needs.
     
  6. tanlin thread starter macrumors newbie

    Joined:
    Jun 9, 2006
    #6
    hi and thanks very much

    i'm a bit of a novice--can you tell me how to find the history.plist file?

    and then once i've got it, how exactly do i use the code you've supplied to extract text? i'm not sure how to go about doing this?

    thanks
     
  7. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #7
    mrichmon (nice job, btw), gave you the path to the .plist.

    Your home directory -> Library -> Safari -> History.plist

    To do what he detailed above, open the Terminal.app and copy & paste what he wrote.

    I might suggest using ">>" rather than ">", as ">>" will APPEND to the file "strings.txt". ">" will compeltely overwrite it everytime.
     

Share This Page