Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Yr Blues

macrumors 68030
Original poster
Jan 14, 2008
2,687
889
Trying to copy a hundred safari bookmarks to textedit but it only shows up as the names and not the URL. I turned plain formatting on. I need it to show as URL addresses and not names.
 

revmacian

macrumors 68000
Oct 20, 2018
1,745
1,468
USA
You should be able to drag and drop the bookmarks from Safari's sidebar into TextEdit. Not sure how you'd do a batch of 100, though. Drag and drop one-at-a-time works to show url's, batch drag and drop only shows names.
 
  • Like
Reactions: Yr Blues

revmacian

macrumors 68000
Oct 20, 2018
1,745
1,468
USA
That's the problem. I have hundreds of bookmarks that I can't do one by one unless I want to spend hours and hours.
You can try Safari > File > Export Bookmarks...
Export to an html file, then open that file in TextEdit and do some find & replace edits so that you are left with only the url's.

for example:
Find: <A HREF="
Replace with: (empty, don't type anything here)

That might take some time but it will leave you with just the url's.

UPDATE: I just did that with mine (47 bookmarks) and it took about a minute.
 
Last edited:

Yr Blues

macrumors 68030
Original poster
Jan 14, 2008
2,687
889
You can try Safari > File > Export Bookmarks...
Export to an html file, then open that file in TextEdit and do some find & replace edits so that you are left with only the url's.

for example:
Find: <A HREF="
Replace with: (empty, don't type anything here)

That might take some time but it will leave you with just the url's.
I tried that, but when I opened it in TextEdit it shows as blue hyperlinks. Then I click Plain Text and it only shows title names.

I think the latest macOS update screwed with copy/paste bookmarks because it worked before the update.
 

revmacian

macrumors 68000
Oct 20, 2018
1,745
1,468
USA
I tried that, but when I opened it in TextEdit it shows as blue hyperlinks. Then I click Plain Text and it only shows title names.

I think the latest macOS update screwed with copy/paste bookmarks because it worked before the update.
In TextEdit preferences:
Under New Document > Format, choose 'Plain Text'
Under Open and Save: Check the box labeled 'Display HTML files as HTML code instead of formatted text'

That should show HTML code as text instead of links. Then try opening the bookmarks html file again.
 

Yr Blues

macrumors 68030
Original poster
Jan 14, 2008
2,687
889
In TextEdit preferences:
Under New Document > Format, choose 'Plain Text'
Under Open and Save: Check the box labeled 'Display HTML files as HTML code instead of formatted text'

That should show HTML code as text instead of links. Then try opening the bookmarks html file again.
Thanks. That's just a mess because of the "end quote" HTML text can't easily be deleted.

I think my only real answer is to see if Apple will fix this bug in the next update.
 

revmacian

macrumors 68000
Oct 20, 2018
1,745
1,468
USA
Thanks. That's just a mess because of the "end quote" HTML text can't easily be deleted.

I think my only real answer is to see if Apple will fix this bug in the next update.
Actually..

Find: ">
Replace with: (4 spaces, or 5, or..)

This has me wondering if TextEdit can use regex in find & Replace.
 

Yr Blues

macrumors 68030
Original poster
Jan 14, 2008
2,687
889
Actually..

Find: ">
Replace with: (4 spaces, or 5, or..)

This has me wondering if TextEdit can use regex in find & Replace.

But then it'll end each address with the title of the address.

vXl4UL1.jpg
 

revmacian

macrumors 68000
Oct 20, 2018
1,745
1,468
USA
But then it'll end each address with the title of the address.

vXl4UL1.jpg
Ok, I found a way to do it but requires the mouse.. kind like regex but works fine.

Here is your "find". Highlight this and Command+C to copy. Then paste it into the Find box. This grabs everything from the end quote of one line to the opening quote of the next line.
find.png



Here is your "replace". Highlight this and Command+C to copy. Then paste it into the Replace box. This just grabs a new line char to make sure each url is in its own line.
replace.png

Then, hit the "All" button and you should be good. You'll have to tweak the first and last lines in the file by hand, but that's better than editing hundreds of lines. Make a copy of the file in case you make a mistake.

I was actually surprised that TextEditor could do this, and I now have new favorite text editor :)
 
Last edited:

Yr Blues

macrumors 68030
Original poster
Jan 14, 2008
2,687
889
I appreciate your help, but I can't comb through hundreds-thousands of bookmarks to do this.
 

revmacian

macrumors 68000
Oct 20, 2018
1,745
1,468
USA
I appreciate your help, but I can't comb through hundreds-thousands of bookmarks to do this.
You only have to do the copy and paste once for Find (first screenshot) and once for Replace (second screenshot). Then hit the replace "All" button and TextEdit will perform the same command on every line. Doesn't matter if you have ten lines or ten thousand.. you're just telling TextEdit what to find and what to replace it with - and then the app does it for every line because you pressed the "All" button.
 

Yr Blues

macrumors 68030
Original poster
Jan 14, 2008
2,687
889
You only have to do the copy and paste once for Find (first screenshot) and once for Replace (second screenshot). Then hit the replace "All" button and TextEdit will perform the same command on every line. Doesn't matter if you have ten lines or ten thousand.. you're only copying and pasting once for find and once for replace.
Are you saying that there's a wildcard in the find/replace?

In my photo it shows an additional title at the end of each URL.
 

revmacian

macrumors 68000
Oct 20, 2018
1,745
1,468
USA
Are you saying that there's a wildcard in the find/replace?

In my photo it shows an additional title at the end of each URL.
It doesn't matter what's at the end of each url, as long as you highlight what you want to find and then what you want to replace it with, TextEdit will do it. Look carefully at the screenshots I posted.
 

revmacian

macrumors 68000
Oct 20, 2018
1,745
1,468
USA
Here is a YouTube video that is very helpful when doing this type of thing in TextEdit:

[doublepost=1544752885][/doublepost]
You want to use "Insert Pattern". It's the last option under the find button at the left. And then your find and replace would look like this so it'd leave just the URLs:

View attachment 810667
Thank you! I knew there had to be some type of regex in this app. Very helpful!
 
  • Like
Reactions: Jessica Lares
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.