Is it possible to create a perspective via JXA?

I’m trying to build a JXA script that. amongst other things, will set up a new perspective in Omnifocus.

One reason why I’m trying to create a perspective from a script is that I want to get and store the perspective’s identifier at the time it is created, so that this is available for other functions.

After much searching, I have not found any interface that enables create perspective to be scripted.

Can anyone confirm that it is not possible to create a perspective from JXA? thanks

I can’t answer your question but I would observe that automatically creating a perspective would be handy as part of automation to set up for eg a client engagement.

I’m not sure if this is your case - because I’m not sure exactly what you want to make available to which other functions.

Hi Martin, good to know I’m not alone in needing this functionality!

My use case is quite similar to yours. I have a new project script that sets up things such as directory structures, file templates, and (hopefully) an associated Omnifocus perspective.

To be honest, I would be happy even if it were only possible to initialise the perspective from a script, and I’d need to go into Omnifocus to manually configure the view (not ideal, but I’d work with it).

I could then automatically grab the perspective’s identifier, and have this available for e.g., open project and close project type functions.

Hopefully someone here can confirm whether the API exposes a create perspective method or not.

It’s not currently possible (OmniJS or JXA/Applescript APIs).

1 Like