- Make a new Automator document of type "App"
- Add these three steps in order
- Remember to replace
mikker
with your own username in the AppleScript scripts
Created
May 13, 2020 20:59
-
-
Save mikker/9304b2c2f14e500c4cc9063e6d8bc9af to your computer and use it in GitHub Desktop.
Open Reading List in Tabs.app
This file contains 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 characters
-- 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 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 characters
#!/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 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 characters
-- Cleanup | |
tell application "Finder" | |
move file "Macintosh HD:Users:mikker:Bookmarks.plist" to trash | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment