Kelson01 Posted November 23, 2021 Share Posted November 23, 2021 (edited) I take notes on apple notes when I watch youtube tutorials so I can create a searchable database & so I can better learn what I am trying to do. Every time I watch one of these videos I copy the title & link of the video and make that the title of the note so I can easily find the video again. I think making a workflow to do this would be possible. Does anyone know of anything that would do this? Edit: I only want the Title + URL of video to be put on the clipboard, it doesn't have to paste it into notes for me. Edited November 23, 2021 by Undertaker01 Link to comment
Hans-Pe Posted November 24, 2021 Share Posted November 24, 2021 To accomplish this, I built an Automator Service, which consist of only one Applescript: on run {input, parameters} (* Your script goes here *) set htmlout to "" tell application "Safari" repeat with t in tabs of window 1 set el_li to "<li><a href=" & URL of t & ">" & name of t & "</a>" set htmlout to htmlout & el_li end repeat set htmlout to "<ul>" & htmlout & "</ul>" end tell set textutil to "| textutil -stdin -inputencoding utf8 -format html -convert rtf -stdout | pbcopy" do shell script "echo " & quoted form of htmlout & textutil (* escape erforderlich*) return input end run Of course you could put this script into an Alfred workflow as well. Link to comment
vitor Posted November 24, 2021 Share Posted November 24, 2021 [HOW TO] Get frontmost tab’s url and title of various browsers covers exactly this. The code works as is for your use case. This Workflow does what you ask. It outputs the title and URL each on their own line. Kelson01 1 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