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

Share this post

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...