Created
May 13, 2020 20:59
-
-
Save mikker/9304b2c2f14e500c4cc9063e6d8bc9af to your computer and use it in GitHub Desktop.
Revisions
-
mikker created this gist
May 13, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ # Open Reading List in tabs 1. Make a new Automator document of type "App" 1. Add these three steps in order 1. Remember to replace `mikker` with your own username in the AppleScript scripts This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ -- Copy the file to $HOME because of some permissions issue tell application "Finder" copy file "Macintosh HD:Users:mikker:Library:Safari:Bookmarks.plist" to folder "Macintosh HD:Users:mikker" end tell This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ #!/usr/bin/env ruby # Note! Set Shell to "/usr/bin/ruby" and install a gem: # $ gem install CFPropertyList require 'cfpropertylist' require 'fileutils' path = File.expand_path '~/Bookmarks.plist' plist = CFPropertyList::List.new file: path list = plist.value.value["Children"].value.select do |item| if title = item.value["Title"] title.value == 'com.apple.ReadingList' end end.first.value["Children"].value bookmarks = list.map do |item| item.value["URLString"].value end.reverse puts "Opening #{bookmarks.count} tabs " bookmarks.each do |url| `open "#{url}"` end This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ -- Cleanup tell application "Finder" move file "Macintosh HD:Users:mikker:Bookmarks.plist" to trash end tell