Syntax autocomplete definitions

For the “draft” type, there a way to
a) set a queryTagFilter for tag OR tag?
b) limit drafts returned to the inbox?

Experimenting with refining the way I handle projects in Drafts, and would like to use autocomplete to insert project references (based on drafts tagged with “projects”), but looking for a way to filter archived projects from that list…

Also experimenting with scoped project tags, hence the OR (e.g. an autocomplete list that could do projects::active OR projects::waiting).

Ideally, I think I’m looking to achieve a queryTagFilter for all “projects::” subtags that aren’t archived, or however close I can get to that…

Not sure I understand. You are wanting to know if you can script a query to get only drafts in the inbox with tags that match the “projects::” scope? The answer is yes, with constructs like:

let drafts = Draft.query("inbox", ["projects::"])

// OR
let ws = new Workspace()
ws.tagFilter = "projects::"
let drafts = ws.query("inbox")

Once you have queried, that is likely a small enough dataset that you could figure out the unique values of “projects::” subtags reasonably efficiently.

My bad for not being clearer. Wasn’t one of my best mornings!

I was looking at defining an autocomplete list in my syntax, using the “draft” type autocomplete object. Trying to figure out whether I can:
a) only reference inbox drafts in the autocomplete list (looks like it currently defaults to “all”?)
OR
b) target more than one subtag via the queryTagFilter

…so when I tap the trigger for my project list, I only really want to see a list of active projects.

I could build my own prompt/menu, but I’d like try to use syntax autocomplete for ease and speed.

You are not going to be able to get that level of filtering specificity out of syntax definitions, I’m afraid.

Got it. Fair enough!

Well, obviously you can’t get exactly what you want, but you can definitely use queryTagFilter in a completion definition to exclude and include tags. Not sure about scope tags and stuff, you’ll have to experiment, but I’m definitely using this.

The cheat I use for excluding archived Drafts, and you’ll probably hate this one, is to give them a tag of archive, then exclude that tag. Is this ugly? heck yes. On the other hand it let me keep using autocomplete on a very, very slow iPad for way longer than I should have with as many Drafts as I have, :smiling_face:.

Not quite as necessary with my new iPad pro, but still.