"change view options" shortcut?

Hi,
I don’t think that there is a baked-in shortcut to “change view options” (e.g., to Available, Remaining, etc). Being allergic to mice, I’d find this really useful!

Has anyone got an Applescript/Javascript that I can borrow to create a shortcut to do this, please?

Thank you!

you could do that via shortcuts that swich to a perspective maybe?
So build a perspective for all required and just link shortcuts to those.

A script was posted somewhere in the distant past. Here it is again.

(*
	jjw revisions
	added method to give notification

	Cycle through specified state
	v0.2
	send feedback to sandro@sandro.org
	use at your own peril 

	changes:
	0.3: removed activate command which all of a sudden no longer works
	0.2: removed flagged as a possible state now that it's in its own filter.
*)

--a list of context names you want selected.  
-- possible options, any combination of:"all","next", "available", "incomplete","complete"
property pCycleList : {"all", "incomplete", "available", "next"}
property pShowNotification : false -- set to true to give notification of state

-- bring OmniFocus to the front
tell application "OmniFocus"

	set theDoc to document window 1 of document 1

	-- set the cycle list
	set availableTaskStates to pCycleList

	-- get current state
	set currentTaskState to selected task state filter identifier of the content of theDoc as text

	-- init next state
	set nextTaskState to ""

	-- get count of total number of available task states in "array"
	set numberAvailableTaskStates to count (availableTaskStates)

	-- identify if current state is in "array"
	repeat with i from 1 to numberAvailableTaskStates
	
		-- check to see if current state is last one in "array" and select first state, or select next available state
		if currentTaskState is equal to item numberAvailableTaskStates of availableTaskStates as text then
			set nextTaskState to 1
			exit repeat
		else if currentTaskState is equal to item i of availableTaskStates as text then
			set nextTaskState to i + 1
			exit repeat
		end if
	end repeat

	-- current task state wasn't in array so just go to the first item
	if nextTaskState is equal to "" then
		set nextTaskState to 1
	end if

	try
		-- select next task state
		set selected task state filter identifier of the content of theDoc to item nextTaskState of availableTaskStates as text
	on error
		return
	end try

	if pShowNotification then
		set theFilter to item nextTaskState of availableTaskStates as text
	
		display notification theFilter with title "Omnifocus"
		delay 0.1 --> allow time for the notification to trigger
	end if
end tell

I have this residing as a button on my OF menu bar.

image


JJW

Thank you JJW!

That’s perfect & is now installed on my menu bar (tho’ I might make an Automator Action so that I can shortcut).

Very useful :-)

Thanks very much for the suggestion, Janov.