Skip to content

Instantly share code, notes, and snippets.

@pdxmph
Created November 6, 2011 03:47
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save pdxmph/1342437 to your computer and use it in GitHub Desktop.
Save pdxmph/1342437 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)
@tzarskyz
Copy link

tzarskyz commented Feb 7, 2014

tell application "Google Chrome"
set pageUrl to get URL of active tab of first window
end tell
tell application "Safari" to add reading list item pageUrl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment