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?
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
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.
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
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.
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.