Using options in requirements

Hi all! I’m looking for more guidance on how to use option in a requirements array.

At least, I hope that’d help me. I’m trying to make a PopClip extension that will only show when Obsidian is in editing view, not reading view. Unfortunately Obsidian still thinks Cut and Paste are available in reading view, so the cut or paste requirements won’t work.

So, how does option work? Does it only draw from PopClip’s preferences or is there some way of generating values for keys in options based on other aspects of a user’s current environment? I.e., Is there a way of using option to take advantage of some other aspect of Obsidian to limit when the PopClip action appears?

1 Like

A quick follow-up: Obsidian does have a menubar menu option that changes depending on your view:

CleanShot 2023-03-24 at 15.24.58

So if there was a way for PopClip to detect the state of that menu option, I think I’d have my solution.

The option= requirements only refer to the values of the extension’s settings (if any) as defined in PopClip prefs. I’m afraid there isn’t any way for it to introspect into the Obsidian user interface. (Welcome to the forum, @ryanjamurphy!)