简体   繁体   English

共享扩展子查询以限制项类型

[英]share extension subquery to limit the item types

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 . 我想只支持images, pdf and url

But share extension is visible in all types. share extension在所有类型中都可见。 ie videos, contacts etc. 即视频,联系人等

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. 它返回true0 ,这意味着true的不匹配,使您的扩展将返回true为每一个类型。 Change this line to the following if you want to limit the image count to 10. 如果要将图像数量限制为10,请将此行更改为以下内容。

).@count == $extensionItem.attachments.@count AND $extensionItem.attachments.@count <= 10"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM