Connected plugin folder error? First attempt at Omni Automation

Hello Omni Automation Junkies.

I’m attempting my first Omni Automation script here!

I have an Apple shortcut that will run on my iPad. It opens two instances of OmniFocus on the iPad.

Then it runs a plug-in. I wanted to show a custom perspective called “due soon” on the left window and the OmniFocus Forecast perspective on the right.

I have no clue about javascript. I asked AI how would I do this. It suggested that I use a javascript and it created this word salad:

```</code></pre>

/{
“type”: “action”,
“targets”: [“omnifocus”],
“author”: “Wilson Ng”,
“identifier”: “com.user.of.splitview-setup”,
“version”: “1.0”,
“description”: “Sets Left side to Due Soon custom perspective, Right side to Forecast”,
“label”: “Set Up Split View Perspectives to show due soon and Forecast”,
“shortLabel”: “Split Setup”
}
/
(() => {
var action = new PlugIn.Action(function(selection, sender) {
// App.windows arrays all active window layers currently on screen
var windows = App.windows;

    if (windows.length >= 2) {
        // 1. Configure the Left side window (Index 0)
        // Replace "Your Custom Perspective" with the exact name of your custom view
        windows[0].perspective = Perspective.Custom.byName("due soon");
        
        // 2. Configure the Right side window (Index 1)
        windows[1].perspective = Perspective.BuiltIn.Forecast;
    } else {
        // Fallback if you forgot to open the app in split-screen first
        document.windows[0].perspective = Perspective.BuiltIn.Forecast;
        new Alert("Split View Required", "Please open two OmniFocus windows side-by-side first.").show();
    }
});
return action;

})();

</code></pre>```

I created an iPad Home screen shortcut to start the shortcut. It opened the two OmniFocus windows and started the Omni Automation. But now I get this notification:

I went to Settings > Automation > Configure plug-ins and see that the plugin is in the OmniFocus iCloud folder. It appears connected.

Am I missing something? Help? 😟

Sorry, couldn’t figure out Markdown code blocks. It’s late in the evening here and my brain is now mush.

ok, churning away at it again…

after a bout with AI, I discovered a little more…

I turned on Developer mode in OmniFocus settings. Still no go.

after struggling further, AI said the sandboxing didn’t allow me to tap on a Home Screen shortcut to run the Apple Shortcut.

AI suggested that I use a URL to run a Javascript. But I guess the URL doesn’t seem to work… sigh, back to the drawing boards.

The URL encoding’s original javascript was this:

(() => {
var windows = app.windows;
if (windows.length >= 2) {
windows[0].perspective = Perspective.Custom.byName(“due soon”);
windows[1].perspective = Perspective.BuiltIn.Forecast;
}
})();