OF4 - Set Folder Focus with IOS Shortcuts

Is it possible to set folder focus with IOS shortcuts in OF4 ?

I know it´s possible from the “Project” view, but I´m just wondering about a way to do it quicker…

You can use an ‘Omni Automation Script’ action in a shortcut, with a script like:

(() => {
    try {
        picks = [flattenedFolders.byName("my Folder")]
        document.windows[0].focus = picks
    } catch {}
})()

The folder/project picks array can be derived however you like, such as by using shortcut variables.

The focus command only works if OF is running, even in the background, so that there’s an “open window”. That’s why I included a try/catch, to ignore the error that may get returned. An alternative is to start the shortcut with a ‘Show [Folder] in OmniFocus’ action, which will open the app, but this will switch to the Projects perspective.

1 Like

Awsome!

This script makes my workflow alot smoother, jumping between different folder focus for example “Personal” and “Profesional”.

Theese are the little things that makes a big different!

Thank you so much 🙏

1 Like

But one more thing, do you have a script to also clear the folder focus ?

When I think better about it, it´s actually not needed

The only time I would need it is for the “today” perspective, If I want to see all areas… but then I just click “x” on the Focus.

So i´m good

Again, thank you very much 🙏

You’re welcome. Omni Automation is great for these kinds of small customisations.

The focus can be cleared by setting it to empty: document.windows[0].focus = []

1 Like

Hi Folks,
I have a limited understanding regarding the use of Omni Automation scripts. Can I clarify how and where) this Omni Automation Script is ‘installed’?

I use it lile this



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