By user320412


2019-02-08 15:06:55 8 Comments

I got used to this routine my idle times:

  • Open hacker news, SE, other sources on my iphone.
  • Open interesting links as new tabs.
  • Read for a while.
  • Leave tab to remind myself to save it somewhere.

The obvious conclusion is that I found myself hitting the 500 tabs limit pretty easily. The last time I opened them manually in my macbook through iCloud, and then used a nice script to save all links with their name and url in a text file for future parsing.

I'm getting close back again (488 at the time of writing), and I'm wondering if there's anything I can do with the shortcut app that can save me at least the manual opening of 500 tabs.

Disclaimer: I know I should use pocket or Instapaper or whatever, but what I need is a solution for the already opened tabs, not for the future.

2 comments

@xaviondono 2019-02-13 21:29:43

OP Here. If you are in a similar situation, I've found a workaround. It's not great, but it works.

  • First get Cloudy Tabs
  • Make sure to enable Full disk access for it if you are running mojave.
  • Select Open All tabs from> iPhone
  • Wait for a while, this can be hard on your computer (I had 323 tabs opened)

You can then use Allans script if you want your output in html, or get a markdown file with this one: list-safari-tabs by Martin Engler.

If you like, you can also use this one: send-everything-to-instapaper. Take care though that this one will also close all tabs.

@Allan 2019-02-08 17:05:23

You can do this with AppleScript and iCloud Tabs (synchronizes your Tabs between your iOS device and your Mac). The following code with parse through all of the tabs in all of your Safari windows and write an HTML link for each one on a new line.

-- Set up the initial HTML document
set output to "<!DOCTYPE html>
" & "<html lang=\"en\">
" & "  <head>
" & "  <meta charset=\"utf-8\">
" & " <title>Safari Tab URLs</title>
" & "</head>
" & "<body>
"


tell application "Safari"

    -- Count the number of Windows
    set numWindows to number of windows


    repeat with w from 1 to numWindows

        --Count the number of Tabs
        set numTabs to number of tabs in window w

        repeat with t from 1 to numTabs

            -- Set the Tab Name and URL values
            set tabName to name of tab t of window w
            set tabURL to URL of tab t of window w

            -- Create the Tab link and write the code
            set output to output & "    <a href=\"" & tabURL & "\">" & tabName & "</a>" & linefeed as string
        end repeat
    end repeat
end tell

-- Close out the HTML document
set output to output & "</body>
" & "</html>
"

-- Write the entire HTML document to TextEdit

tell application "TextEdit"
    activate
    make new document
    set the text of the front document to output
end tell

@xaviondono 2019-02-08 18:29:56

Thank you Allan, I’ll look at this and see if it works better that the one I cobbled up together. I’ve edit the question to make clearer that the issue is that I have all those tabs opened on my iphone (my bad, it was not clear at all).

@Allan 2019-02-08 18:45:17

The script was for Safari on a Mac. However, if you are using it on a Mac, using iCloud Tabs to sync them between your iPhone and your Mac, this script will work.

Related Questions

Sponsored Content

0 Answered Questions

Shortcut to close tabs with matching URL pattern

  • 2018-11-11 07:37:26
  • iMerchant
  • 11 View
  • 1 Score
  • 0 Answer
  • Tags:   ios shortcuts-app

1 Answered Questions

2 Answered Questions

1 Answered Questions

[SOLVED] AppleScript URL from open safari window

  • 2016-05-24 05:50:10
  • Bradman175
  • 712 View
  • 0 Score
  • 1 Answer
  • Tags:   safari applescript

1 Answered Questions

[SOLVED] ios: workflow app, is there a way to open several new tabs?

  • 2015-04-15 11:42:21
  • Var87
  • 1459 View
  • 0 Score
  • 1 Answer
  • Tags:   ios automation

1 Answered Questions

[SOLVED] iOS: open text file with not text extension

1 Answered Questions

[SOLVED] Safari 6: Open and close tabs with middle click?

1 Answered Questions

[SOLVED] Open Safari With Numerous Tabs Open?

4 Answered Questions

[SOLVED] Safari reopens last open tabs?

  • 2011-07-21 08:48:57
  • Michael Stum
  • 8110 View
  • 11 Score
  • 4 Answer
  • Tags:   safari lion

Sponsored Content