Toggle "Use Project Hierarchy" through keyboard shortcut?

The left sidebar can show either contexts or folder/projects. One can toggle between these two settings under “Show View Options” by choosing one of the two radio buttons.

I would prefer to use a keyboard shortcut instead of a GUI. Does anyone know how to achieve a keyboard shortcut using e.g. applescript? The radio button’s name it “Use project hierarchy”.

Yes, sandro@sandro.org wrote some OF Applescripts with “cycle” in the title. They change settings in the view filter, like “available” vs “remaining.” If you get those scripts and look in the OF applescript dictionary, you should be able to figure out how to toggle back and forth between project and context hierarchy.

Once you have the Applescript working, you can fire it from the keyboard using Keyboard Maestro.

I wrote those many years ago and would be shocked if they still work as expected. That said, I’d love to hear feedback on them - helpful? ideas? bugs? Been thinking about pushing them to Github for a while now and this might be the nudge ;)

1 Like

Many thanks both for your replies! Sandro, the scripts that you and others produced several years ago have been very important for me. They have saved me lots of time over the years. I have been using variations of yours and others scripts for years, and I learned this through yours and others websites:

http://sandro.org/omnifocus/index.php
http://c-command.com/scripts/omnifocus/defer-to-tomorrow
https://gist.github.com/benwaldie/4583391 (by Ben Waldie)
http://www.helmuthauser.com
https://gist.github.com/tofias (by Tofias)

My most precious scripts are for deferring tasks through keystrokes, and I also execute those via Keyboard Maestro as @amamorph suggests.

Where my knowledge ends, is how to interact with the new pop-up window “Show View Options”. I can run the Accessibility Inspector.app and I know that the radio button’s name is “Use project hierarchy.” But I cannot figure out how to create a script that toggle between the two radio buttons, and I haven’t been able to find a script that shows how to interact with the pop-up window.

1 Like