Sridhar Katakam Posted April 3, 2013 Share Posted April 3, 2013 Hi, I am not sure if this is the right forum for requesting for a simple (I hope) workflow. I would like to type "copyurl" and have the active tab's URL in Chrome or Safari (whichever browser is in front) be copied to clipboard. Thanks in advance. Link to comment
RodgerWW Posted April 3, 2013 Share Posted April 3, 2013 This is pretty straightforward ... for Safari at least. Make a new workflow, from "Templates"\"Essentials"\"Keyword to script" Double click on Keyword in the workflow area and set up your keyword with no argument, then save. Double click on Run Script and in the language drop down select /usr/bin/osascript. in the Script area paste this: tell application "Safari" activate set theURL to URL of front document set the clipboard to theURL & return end tell then click save. Then load whatever site you want in Safari, open alfred and type your keyword and you will have Safari's url on the clipboard. Link to comment
Sridhar Katakam Posted April 3, 2013 Author Share Posted April 3, 2013 Thanks, that worked for Safari. Tried changing "Safari" to "Chrome" but that did not work. Link to comment
jdfwarrior Posted April 3, 2013 Share Posted April 3, 2013 Thanks, that worked for Safari. Tried changing "Safari" to "Chrome" but that did not work. Try this for Chrome: tell application "Google Chrome" set theURL to the URL of the active tab of window 1 set the clipboard to theURL end tell Link to comment
Sridhar Katakam Posted April 3, 2013 Author Share Posted April 3, 2013 Thanks. That worked. Made this to a workflow: http://cl.ly/2l3n0l3E302r Link to comment
jdfwarrior Posted April 3, 2013 Share Posted April 3, 2013 Thanks. That worked. Made this to a workflow: http://cl.ly/2l3n0l3E302r Great! Glad I could help out. Link to comment
masterninja01 Posted October 1, 2013 Share Posted October 1, 2013 Now, what about getting the url for every tab in the window or even getting the urls for the selected tabs only. Has anyone figured this out. I've tried and failed. But I'm not sure this is possible in Chrome due to their lack of applescript support. Link to comment
vitor Posted October 1, 2013 Share Posted October 1, 2013 But I'm not sure this is possible in Chrome due to their lack of applescript support. What makes you think that? Its applescript support is pretty acceptable, and nothing to scoff at. It’s a lot better than a big percentage of apps out there, and certainly better than the majority of browsers, which range from having none to ridiculously deficient applescript support. It’s a genuine question, though, what makes you feel its applescript support is poor? Link to comment
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