Skip to content

Instantly share code, notes, and snippets.

@shengchiliu
Forked from pdxmph/save_chrome_url.rb
Created April 19, 2018 16:02
Show Gist options
  • Save shengchiliu/cbe202ac6ec09c6611b46c326ca29e05 to your computer and use it in GitHub Desktop.
Save shengchiliu/cbe202ac6ec09c6611b46c326ca29e05 to your computer and use it in GitHub Desktop.
Add a URL from Chrome to Safari's reading list
#!/usr/bin/env ruby -wKU
require "rubygems"
require "appscript"
include Appscript
chrome = app("Google Chrome")
safari = app("Safari")
chrome_tab = chrome.windows[1].active_tab
save_url = chrome_tab.URL.get
save_title = chrome_tab.name.get
safari.add_reading_list_item(save_url, :with_title => save_title)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment