Import multiple URLs as Bookmarks

I’ve a list of URLs and want them to be imported as bookmarks. When I paste the URLs, I just get a note. I tried some Download Scripts from the Scripts menu on this note and the selection, but without success. Also, the Clip feature and download manager only accept one URL. Have I missed something, or do I have to write a script?

1 Like

You have a list… where ?

When I paste the URLs, I just get a note.

When you paste them… where ?
And what would you expect to happen?

The URLs are in Text files, extracted from Markdown or from a website.

I pasted them in a folder/group, I also tried dragging. Dragging multiple items from GoodLinks does work.

1 Like

Then you’d need to process the file to extract the links and convert them to the desired format.
As a simple example, handling a selected Markdown document…

tell application id "DNtp"
	if not (exists content record) or (record type of content record is not markdown) then return
	set allLinks to get links of (source of (content record) as string)
	if allLinks is not {} then
		repeat with thisLink in allLinks
			with timeout of 3000 seconds
				create PDF document from thisLink in (current group) with pagination
			end timeout
		end repeat
	end if
end tell
1 Like

Thanks for the script. The text file was only an example and forgot to say, that I don’t want to import it. It‘s a temporary note where I collect something. It could also happen in Pages, Notes or elsewhere. I want to copy these link lists and paste them into DT, so that it will bookmark every URL.

I‘ll try to modify the script to deal with the clipboard.

You need to distinguish between a single URL or having multiple URL’s.

A single URL can simply be put in DT using copy and paste. Copy the URL, select the inbox or any other folder and paste.

If you have multiple URL’s in your copy buffer, it represents a document. Hence you get a document when you paste this in DT. You need a script to separate them or copy/paste them one by one.

2 Likes

In the past multiple bookmarks could be dragged e.g. from Safari to DEVONthink, the Finder or into a rich text document in TextEdit. This doesn’t seem to work any longer, at least on Tahoe.