Preserving Open Tabs through Quits/Restarts

The title sort of sums it up. My OF workflow has me having six tabs, each with a custom perspective. It works beautifully for me. However…

Anytime I close OF, the tabs and their perspectives have to be set-up again when I re-open it. Is there any way for these to be remembered/preserved so I don’t have to go through that exercise?

Thanks.

David

I think OmniFocus doesn’t preserve tab state.
Maybe this script would work for you.

--unlocked2412

-- ENTER DESIRED PERSPECTIVES NAMES BETWEEN THE QUOTES
property namePerspective1 : ""
property namePerspective2 : ""
property namePerspective3 : ""
property namePerspective4 : ""
property namePerspective5 : ""
property namePerspective6 : ""

-- MAIN SCRIPT
tell application "OmniFocus"
	tell front document
		make new document window
		make new document window
		make new document window
		make new document window
		make new document window
		-- SET PERSPECTIVES
		set perspective name of document window 6 to namePerspective1
		set perspective name of document window 1 to namePerspective2
		set perspective name of document window 2 to namePerspective3
		set perspective name of document window 3 to namePerspective4
		set perspective name of document window 4 to namePerspective5
		set perspective name of document window 5 to namePerspective6
	end tell
end tell

activate application "OmniFocus"
tell application "System Events"
	tell application process "OmniFocus"
		tell menu bar 1
			tell menu "Window"
				tell menu item "Merge All Windows"
					perform action "AXPress"
				end tell
			end tell
		end tell
	end tell
end tell
1 Like

Thanks so much. Will give that a try as soon as I have a moment (hopefully later this evening) and report back.

David

Hi, have tried it and it’s cool :). It isn’t quite consistent with it’s ordering and numbering but it’s easy enough for me to drag tabs around afterwards—and I suspect that’s not a fault of the script but more a randomness around how The Merge All Windows option in Omni behaves.

Thanks so much.

David

You’re welcome. I tested it several times and it preserves the order. When it merges tabs, in tab 1 is namePerspective 1, in tab 2 is namePerspective 2, etc…If you post more information, maybe I can give you some insight…
In the meantime, you can add this line of code: delay 0.3 between the lines set perspective name of.... Like this:

set perspective name of document window 6 to namePerspective1
delay 0.3
set perspective name of document window 1 to namePerspective2
delay 0.3

I asked about this before, and Omni advised that there is a Mac setting that will remember your tabs.

It’s in macOS General settings here:

You need to uncheck this setting and OF will remember your tabs. The downside is that this is an OS setting, so anything else you leave open when shutting down your Mac (e.g. documents, spreadsheets, etc) will all reopen.

Regards,
Peter.

1 Like

Peter, that works perfectly, thanks. As you say the only downside is that other apps also reopen but it’s better than having to re-set my tabs in OF every time. I think the combination of that and unlocked2412’s script will do me nicely for re-boot/close and re-open OF.

Thanks.

David

Hello is there a solution to this from OF? It would be awesome if they could support this natively!

For thoroughness: A quick search of the OF Omni Forums reveals these other threads on remembering tabs:


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.