• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Safari Bookmarks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Safari Bookmarks


  • Subject: Safari Bookmarks
  • From: Christopher Stone <email@hidden>
  • Date: Sat, 22 Sep 2012 06:06:03 -0500

Hey Folks,

I wonder why Safari after so many years still has the worst-in-class bookmark management of any major web browser.

The most glaring deficiencies in my opinion are:

 * Poor user interface.
 * Poor searching.
 * No tags or support for other metadata.
 * No shortcuts.

Features that we've taken for granted in other browsers for many years strangely seem to be beneath Apple's notice.

Safari's bookmark system is serviceable for day-to-day stuff, but for managing many hundreds or thousands of bookmarks it's a wash.  You just can't find things easily enough, and organizing them is overly tedious.

There are always options like URL Manager Pro, Little Bookmark Box (both of which I own), and other 3rd party bookmark managers, but even though some of these are quite nice they often lack features I want.

Enter Applescript and the Finder.

This script saves a .webloc file referencing the front page in Safari to the folder ~/Documents/Bookmarks_Safari/.

It would be easily possible to create different scripts to save in specific folders such as 'Urgent' or 'Pending', and it would also be easy to provide a pick-list of save locations.

In the Finder you can organize things to your heart's content, and you can tag items using Finder-comments or a metadata-aware utility like TagIt, Leap, PathFinder, etc.  Spotlight then gives you many options for searching, and a utility like HoudaSpot makes Spotlight even easier to use in sophisticated fashion.

I use FastScripts for most of my script-running needs, and I use Keyboard Maestro for a few that require more sophisticated options.

Enjoy.

--
Chris

------------------------------------------------------------------------------------------------
#       Author: Christopher Stone <email@hidden>
#      Created: 2012-09-22 : 04:34
#     Modified: 2012-09-22 : 05:12
#  Application: Safari » Finder
#      Purpose: Write webloc file in the Finder
# Dependencies: None
------------------------------------------------------------------------------------------------
--» HANDLERS
------------------------------------------------------------------------------------------------
on write_to_file_overwriting(someText, targetFile)
  try
    set resultNumber to open for access targetFile ¬
      with write permission
    set eof of resultNumber to 0
    write someText to resultNumber
    close access resultNumber
  on error errMsg number errNum
    try
      close access resultNumber
    on error errMsg number errNum
      beep
      display dialog "Error: " & errMsg & return & "Error Number: " & errNum
    end try
  end try
end write_to_file_overwriting
------------------------------------------------------------------------------------------------
--» MAIN
------------------------------------------------------------------------------------------------

try

  

  set bkmksFldr to ("" & (path to documents folder) & "Bookmarks_Safari:")
  try
    alias bkmksFldr
  on error e
    do shell script "mkdir " & quoted form of (POSIX path of bkmksFldr)
  end try
  tell application "Safari"
    tell front document
      set _name to its name
      if length of _name > 50 then
        set _name to text 1 thru 50 of _name
      end if
      # Sanitize file name.
      set _name to do shell script "sed -E 's/[:,|/-]/ /g; s/  +/ /g' <<< " & quoted form of _name
      set _url to its URL
    end tell
  end tell
  set fName to bkmksFldr & _name & ".webloc"
  set webLocTmplt to "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
<plist version=\"1.0\">
<dict>
<key>URL</key>
<string>" & _url & "</string>
</dict>
</plist>
"
  write_to_file_overwriting(webLocTmplt, fName)

  

on error e number n
  set e to e & return & return & "Num: " & n
  tell me to set dDlg to display dialog e with title "ERROR!" buttons {"Cancel", "Copy", "OK"} default button "OK"
  if button returned of dDlg = "Copy" then set the clipboard to e
end try

------------------------------------------------------------------------------------------------

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: AW: Apple Mail Date Remote & Local and IP Lookup
  • Next by Date: List of Recently Modified Technote
  • Previous by thread: AW: Apple Mail Date Remote & Local and IP Lookup
  • Next by thread: List of Recently Modified Technote
  • Index(es):
    • Date
    • Thread