Filtered decks: help finding cards whose note doesn't contain images unless in certain fields

I’m trying to make a filtered deck for use with TTS where the notes may (but don’t need to) contain images only in certain fields. I read the manual and thought I’d be clever and search fields for the <img> HTML element: -"Text:*<img*" (The trailing > left off because tag attributes such as src can be in any order). The problem with this is a blacklist approach and it doesn’t scale well: I’d need to make that query very long to exclude every field in my collection that can’t contain an image. A whitelist approach would involve a query like "-*<img*" or "Extra:*<img*" or "Pixorize:*<img*" which disqualifies cards with images ("-<img") but then (re)qualifies the cards if the images are in non important fields such as Extra. Today I unfortunately discovered that using the whitelist query includes cards that have images in the Text field if they also have an image in the Extra field. When using TTS, I don’t want to include cards with images in the Text field and most other fields.

In the end, I just want a query that selects cards where:
1.images are never in most fields (whitelist)
2. and certain fields may (but don’t need to) have images, but not at the expense of condition 1 above.

I’d greatly appreciate some help refining my query or a flatout “that’s not possible” response

The whitelist approach logically cannot work. If the blacklist search is too cumbersome to construct, I would use a tag like (un)suitable-for-TTS (whichever is easier to implement for you). It involves a bit more work, but it’s much more flexible. You can use one of your above searches to tag a first batch of notes, then refine it as you go along.

An alternative would be to classify your field names. E.g. add “(essential)” to every field that must be fully observable to answer a card. Then you can use a wildcard search: -"* (essential):*<img*".

1 Like

I was afraid of that. Guess I’ll go with something like:
("-*<img*" or "tag:TTS-suitable")

And add that tag to the right notes. Thanks

1 Like