Use AppleScript to get names of all Perspectives

As the title suggests, I want an AppleScript that gets the names of all perspectives. My end goal is to make an Alfred workflow where I can type “of Music” and have it open (and predict) the Music perspective.

I assume if I can get this working with perspectives, I can get it to work with projects as well. Thanks!

Here’s a simple script as a starting point:

tell application "OmniFocus"
	tell default document
		set perspectiveList to name of every perspective
	end tell
end tell
1 Like

Thank you. To any one seeing this in the future, I simply used a keyboard maestro hotkey to launch OF and press CMD+O for me. That does what I wanted in the easiest way.

This might save you some work… omnifocus and alfred