Applescript - bookmark all tabs in ALL WINDOWS in Safari

by jm666   Last Updated October 05, 2018 16:12 PM - source

Safari, have the Bookmark all tabs, function in the menu Bookmarks -> Add Bookmarks for these N tabs. I looking for a way how to do this automatically with applescript in all opened Safari windows.

With other words, want

  1. choose some bookmark folder, let says "Favorites -> Sessions"
  2. cycle over all Safari windows
  3. if the window has only one TAB simply bookmark it into the above folder
  4. otherwise
    • call the Bookmarks -> Add Bookmarks for these N tabs menu item
    • fill the popup window automatically (e.g. Saved Tabs window1, Saved Tabs window2 ... etc.)
  5. repeat from 2

Here is a nice applescript, (also similarly this which could be an good starting point for the development, but asking first here - maybe someone already has done this. :)

Any help, please?

Ps - motivation - The Apple's new policy, (killing everything where some "free fun is detected"), unfortunately caused that one of "must to have" Safari extension - Sessions - stops working in the Safari 12. So, looking for some home-grown functionality.

Related Questions

programatically reload Safari extension

Updated May 23, 2016 08:05 AM