Jump to content

How to get the url of youtube.com in Chrome ?


Recommended Posts

I was trying to make an Alfred workflow to get the link of youtube open in any chrome tab.

 

I have shared my workflow did so far, which only works for Safari, how to make it work for Chrome?

 

The link of my alfred workflow is shared here.

 

So far I have done this to get URL from Safari, but I am struggling how to get this in Chrome?

 

on alfred_script(q)
tell application "Safari"
	repeat with t in tabs of windows
		tell t
			if URL starts with "http://www.youtube.com/watch" or URL starts with "https://www.youtube.com/watch" then
				set vidurl to URL
				set AppleScript's text item delimiters to "&"
				set the item_list to every text item of vidurl
				set strip to text item 1 of vidurl
				set vidurl to the strip as string
				return vidurl
				exit repeat
			end if
		end tell
	end repeat
end tell
end alfred_script

 

 

Edited by Bhishan
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...