How to open plug-in preference dialog in iOS?

I’ve implemented a plug-in which has a preference dialog. The dialog can be opened by clicking the menu item under ‘Automation’ while holding CTRL key in macOS, this implementation is according to the automation documentation.

The problem is, I cannot setup preferences in iOS and I don’t want to connect a keyboard to my iPhone to achieve it.

Another way may be adding a new action to open the preference dialog, but always showing a preference menu item is not elegant.

So how can I solve this problem?

I came to the same conclusions as you. A separate Preferences action will be needed for use on iOS without keyboard. This means that a sub-menu for the plug-in will be created in the Automation menu on macOS, making the main action (if there’s only one) less convenient to access.

A less user-friendly alternative is not to create a Preferences action, just a library function that you call from the Automation Console. That could also be called from an iOS/macOS shortcut.

What I would find ideal is support for accessing a Preferences function provided by the plug-in from OF’s ‘Configure plug-ins’ dialog.

I’ve found a way, not so elegant but is all right.

My plugin works on selected tasks or projects, so in iOS, users should trigger the action by opening the share menu and tap the action in it. Meanwhile, in the home perspective, in the view opened by tapping the console icon, the action is disabled.

So I use this view to do the preferences thing. In the action closure, we can identify the trigger source using the second parameter named ‘sender’. So the logic of the action becomes:

if (sender instanceof MenuItem) {
    prompt_preference_dialog();
} else {
    do_action_job();
}
1 Like

In that situation you could also use as a condition whether the selection parameter is empty.

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