How do you copy bookmarks to textedit?

Discussion in 'macOS' started by Yr Blues, Dec 13, 2018.

  1. Yr Blues macrumors 68020

    Joined:
    Jan 14, 2008
    #1
    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.
     
  2. revmacian macrumors 6502a

    revmacian

    Joined:
    Oct 20, 2018
    Location:
    USA
    #2
    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.
     
  3. Yr Blues thread starter macrumors 68020

    Joined:
    Jan 14, 2008
    #3
    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.
     
  4. revmacian, Dec 13, 2018
    Last edited: Dec 13, 2018

    revmacian macrumors 6502a

    revmacian

    Joined:
    Oct 20, 2018
    Location:
    USA
    #4
    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.
     
  5. Yr Blues thread starter macrumors 68020

    Joined:
    Jan 14, 2008
    #5
    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.
     
  6. revmacian macrumors 6502a

    revmacian

    Joined:
    Oct 20, 2018
    Location:
    USA
    #6
    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.
     
  7. Yr Blues thread starter macrumors 68020

    Joined:
    Jan 14, 2008
    #7
    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.
     
  8. revmacian macrumors 6502a

    revmacian

    Joined:
    Oct 20, 2018
    Location:
    USA
    #8
    Actually..

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

    This has me wondering if TextEdit can use regex in find & Replace.
     
  9. Yr Blues thread starter macrumors 68020

    Joined:
    Jan 14, 2008
    #9
    But then it'll end each address with the title of the address.

    [​IMG]
     
  10. revmacian, Dec 13, 2018
    Last edited: Dec 13, 2018

    revmacian macrumors 6502a

    revmacian

    Joined:
    Oct 20, 2018
    Location:
    USA
    #10
    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 :)
     
  11. Yr Blues thread starter macrumors 68020

    Joined:
    Jan 14, 2008
    #11
    I appreciate your help, but I can't comb through hundreds-thousands of bookmarks to do this.
     
  12. revmacian macrumors 6502a

    revmacian

    Joined:
    Oct 20, 2018
    Location:
    USA
    #12
    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.
     
  13. Yr Blues thread starter macrumors 68020

    Joined:
    Jan 14, 2008
    #13
    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.
     
  14. revmacian macrumors 6502a

    revmacian

    Joined:
    Oct 20, 2018
    Location:
    USA
    #14
    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.
     
  15. Jessica Lares macrumors G3

    Jessica Lares

    Joined:
    Oct 31, 2009
    Location:
    Near Dallas, Texas, USA
    #15
    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:

    Screen Shot 2018-12-13 at 7.46.22 PM.png
     
  16. revmacian macrumors 6502a

    revmacian

    Joined:
    Oct 20, 2018
    Location:
    USA
    #16
    Here is a YouTube video that is very helpful when doing this type of thing in TextEdit:


    --- Post Merged, Dec 13, 2018 ---
    Thank you! I knew there had to be some type of regex in this app. Very helpful!
     
  17. Yr Blues thread starter macrumors 68020

    Joined:
    Jan 14, 2008
    #17
    Thanks. This works for me. I can handle wildcards like that. :)
     

Share This Page

16 December 13, 2018