judgejohn82 Posted August 19, 2014 Posted August 19, 2014 Hi guys, Someone else posted an excellent workflow that allows a user to add the current Chrome URL to Safari's Reading List. I tried altering the code to allow this to work with Firefox, as this is the browser I user personally, but could not get it to work. Does anyone with more techincal skills than I have know how to implement this as a workflow? Any help would be greatly appreciated!
vitor Posted August 24, 2014 Posted August 24, 2014 Firefox has awful Applescript support, and you can’t accurately get the url from the current tab with it (also don’t hold your breath on it ever being reimplemented), which is why you’ll regularly see it excluded from such tools.It is possible to accomplish what you ask, but it relies on ugly hacks like sending specific keystrokes to copy the url to the clipboard. These methods are prone to erros, so you can get unreliable results.Now that we’ve established this isn’t necessarily a good idea and you might get a bad experience from it, here’s how to accomplish what you ask (not throughly tested, but should work). tell application "Firefox" activate tell application "System Events" keystroke "l" using {command down} keystroke "c" using {command down} end tell end tell delay 0.5 set firefoxUrl to the clipboard tell application "Safari" to add reading list item firefoxUrl If you see the wrong url being added regularly (a side-effect of GUI scripting), increase the value of delay (0.5 means half a second). This will invariably open Safari, when adding the url to the reading list. If you don’t use it, and want it to always close after the script runs, replace tell application "Safari" to add reading list item firefoxUrl with tell application "Safari" add reading list item firefoxUrl quit end tell
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now