3
SUBQUERY(
extensionItems, 
$extensionItem, 
SUBQUERY(
$extensionItem.attachments, 
$attachment, 
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "com.adobe.pdf"
).@count == 1
).@count == 1 
OR 
SUBQUERY(
extensionItems, 
$extensionItem, 
SUBQUERY(
$extensionItem.attachments, 
$attachment, 
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.image"
).@count <= 10
).@count == 1
OR 
SUBQUERY(
extensionItems, 
$extensionItem, 
SUBQUERY(
$extensionItem.attachments, 
$attachment, 
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.url"
).@count == 1
).@count == 1

I want to support only images, pdf and url.

But share extension is visible in all types. i.e. videos, contacts etc.

S.J
  • 3,063
  • 3
  • 33
  • 66

1 Answers1

2

This is because of the line:

).@count <= 10

It returns true for 0, that means true for no match, so your extension will return true for every type. Change this line to the following if you want to limit the image count to 10.

).@count == $extensionItem.attachments.@count AND $extensionItem.attachments.@count <= 10"
iamdave
  • 12,023
  • 3
  • 24
  • 53
Ali Sufian
  • 31
  • 3