Spotlight

RSS for tag

Search for files and index your app’s content for searching using Spotlight.

Posts under Spotlight tag

108 Posts

Post

Replies

Boosts

Views

Activity

mdfind - Disable debug output: [UserQueryParser] Loading keywords and predicates for locale "de_CH"
Hey Whenever I run mdfind, it prints some annoying debug output. Example: $ mdfind …………… 2023-04-24 07:21:53.046 mdfind[642:1948002] [UserQueryParser] Loading keywords and predicates for locale "de_CH" 2023-04-24 07:21:53.047 mdfind[642:1948002] [UserQueryParser] Loading keywords and predicates for locale "de" … That's on macOS Ventura 13.3.1 (22E261). I've got another mac with an older macOS, and there mdfind didn't do this. While googling, I found a post on reddit with a "solution", which just filters out those lines from stderr, like so: function mdfind() { /usr/bin/mdfind $@ 2> >(grep --invert-match ' \[UserQueryParser\] ' >&2) } This does not solve the problem, it just hides it. Is there a way to turn off these debug messages? Thanks, Alexander
1
1
1.8k
Apr ’23
App Search API Validation Tool is down
The "Search for Developers" website (https://developer.apple.com/ios/search/) references the App Search API Validation Tool located at https://developer.apple.com/ios/search/. Clicking the link returns an SSL error. The entire subdomain returns this same error (https://search.developer.apple.com).I reported it through Apple's developer feedback, who told me to file a Radar. I filed a Radar and it came back as "could not reproduce."Can anyone else confirm that this site won't load? Perhaps Apple doesn't experience the SSL issue from within its own network?I need to use the validator!
18
0
9.2k
Feb ’23
spotlight/metadata searches are confusing me
In order to set up an asynchronous query looking for a specific application, I have a predicate of:         NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%K LIKE[cd] %@ AND %K = %@",                                                          @"kMDItemDisplayName", name,                                                          @"kMDItemContentType", UTTypeApplicationBundle.identifier]; I tested it with standalone code, and this did what I wanted -- finding applications with the given name. But recently, it seems to have stopped working. That query should be the equivalent of mdfind 'kMDItemDisplayName LIKE[cd] "Safari" AND kMDItemContentType == "com.apple.application-bundle"' but that gives me Failed to create query for 'kMDItemDisplayName LIKE[cd] "Safari" AND kMDItemContentType == "com.apple.application-bundle"'. If I drop the compound, and just do % mdfind 'kMDItemDisplayName LIKE[cd] "Safari"' then I get no output: % mdfind 'kMDItemDisplayName LIKE[cd] "Safari"' %  And yet clearly I do have Safari installed on my system. What am I doing wrong, or missing? Anyone?
3
0
1.6k
Jan ’23
NSMetadataQueryDidFinishGathering not being called enough
I have an app where each item in an NSTableView contains an NSMetadataQuery, to listen for updates to image files that contain the keyword associated with the item. If I write the keywords to, RAW files, everything works as expected and the number label in the row gets updated correctly. However, if I write the keywords to XMP sidecar files, the NSMetadataQueryDidFinishGathering callback isn't called enough times and the count of files affected isn't updated correctly. What is more, the number returned on the final call to the callback seems to vary depending on the time of day, weather, etc Here is the code that I have used to create the predicate for finding keywords in XMP files…       let xmpFileTypePredicate = NSPredicate(fromMetadataQueryString: "kMDItemKind = \"XMP sidecar*\"cdwt")!       let xmpKeywordPredicate = NSPredicate(fromMetadataQueryString: "kMDItemTextContent = \"<rdf:li>\(keyword)</rdf:li>\"cdw")!       let xmpKeywordsMetadataQueryPredicate = NSCompoundPredicate(andPredicateWithSubpredicates: [xmpFileTypePredicate, xmpKeywordPredicate]) Can anyone give me any ideas?
0
0
1.1k
Aug ’22
Get notified when a new application is installed?
Is there a way to get a notification of some type when a new application is installed? The specifics here have to do with "Here is a list of applications we want to monitor"; I use mdquery to find them (so I can get the paths, and information from the bundle). However, if it's not installed yet, then I can't do that. But if it gets installed later, I'd like to.
6
0
2.3k
Aug ’22
How do I get information on messages that have been sent in Messages app in iOS?
I have wondered before how I can find out what messages have been sent and perhaps even to whom and from whom. What is the underlying technology behind the search feature in iOS when the user swipes right from the first screen of the home screen? Is that part of Siri. Setting group Siri and Search together. Does the search feature I speak of use Intents, and is that made accessible to developers. I have also noticed that there is an intent property to the extension context object that passes information between a host app and another app's share extension. I'm brainstorming and looking for any ideas. I hope someone out there have good information for me. macOS has Spotlight. Is that available on iOS?
0
0
1.2k
Jul ’22
Monitor progress of ubiquitous item downloads in iCloud Drive
I'm struggling to find a way to monitor the progress (in percent, or bytes) of a download from iCloud Drive. I.e. files outside of the app's ubiquitous document folder. Our app provides a directory browser (which is accessed using a security scoped bookmark granted by the user). In this browser we want to enable users to download files from iCloud analogous to the user experience provided in Files.app. It seems that NSMetaDataQuery would be the right way to go nowadays. However i don't get any results for queries outside of my own app container. I suppose that's a permission problem? Luckily we can get most of what we need using url's resource values. Also initiating and canceling a download works using NSFileManager. However i found now suitable way of determining a download's progress. NSURLUbiquitousItemPercentDownloadedKey is deprecated and doesn't give any results. Did i overlook something? Is there a way to get NSMetaDataQuery working with security scoped bookmarks to folders?
0
1
1.4k
Jul ’22
Why does spotlight hate me?
This query should find everything with a display name of "Safari." That should include, for example, /Applications/Safari.app. [bigbook:/tmp] sef% mdfind 'kMDItemDisplayName == "Safari"c' /Library/Application Support/Apple/Safari /Library/Apple/System/Library/Assistant/Plugins/Safari.assistantBundle/Contents/MacOS/Safari /Users/Shared/Previously Relocated Items 1/Security/System/Library/AssetsV2/com_apple_MobileAsset_MacSoftwareUpdate/f7b05c91052116c046919f72de2c03a86cabcf3e.asset/AssetData/payloadv2/ecc_data/System/Library/Templates/Data/Applications/Safari.app /Users/Shared/Previously Relocated Items/Security/Developer/SDKs/MacOSX10.6.sdk/System/Library/PrivateFrameworks/Safari.framework/Versions/A/Safari /Users/Shared/Previously Relocated Items/Security/Developer/SDKs/MacOSX10.7.sdk/System/Library/PrivateFrameworks/Safari.framework/Versions/A/Safari /Users/sef/Applications/Microsoft Office 2004/Office/Themes/safari /Users/sef/Library/Application Support/SyncService/LastSync Data/Safari And yet, /Applications/Safari.app is in fact missing from there. Why? (This used to work. But then mds was broken on my machine, so I bit the bullet and upgraded to Monterey. Multiple Monterey systems are showing this weird behaviour.)
1
0
831
Jun ’22
Spotlight importer: which key/value to make a file UTI seen as a "Spreadsheet" and not as "Other"
On my spreadsheet application, with its own UTI, I wrote a Spotlight importer plugin. It works well, except that Spotlight group the found files as "Other" and not as "Spreadsheet". My UTI conforms to public.spreadsheet. Any idea? Is there a special kMDxxx key/value to set for that in the importer?(see: https://developer.apple.com/library/archive/documentation/CoreServices/Reference/MetadataAttributesRef/Reference/CommonAttrs.html ) Thanks!
0
0
1.1k
Jun ’22
trying to figure out where to get a link for "search [query] in App Store"
I'm trying to create a quicklink/command (for personal purposes Raycast) that basically opens the App Store and searches input. I don't know much about developing/backend/code stuff but considering it's easy to create a command that searches other browsers, engines, databases I figure there has to be a way. Hoping this isn't like reddit where someone asks a question and everyone answers it condescendingly or sarcastically just because, reddit.
1
1
997
Jun ’22
Track traffic that comes from spotlight or app deeplinking
Hi girls &amp; guys!I wonder if I can track traffic that comes from Spotlight or other app deeplinking launches in my analytics.When Spotlight opens my app with a deeplink, can I provide an argument that differs when the user comes from Spotlight or Safari search or opens my url via another way? Reason is: Currently I get traffic to my mobile page via Google. On my page I take the HTTP referrer and know it's SEO-traffic from Google. For SEA Adwords traffic I specify another URL. Means, I can identify my traffic sources.When Spotlight will take over this search part, there will me no HTTP referrer I can take. I then cannot identify if the user comes from Spotlight Search or another app launch way (e.g. smart app banner).Hope somebody has ideas to specify different arguments for sources when deeplinking to an app.Best regards
3
0
2.7k
Apr ’22
Core Spotlight does not work on macOS.
Hi, guys.I have an issue with Core Spotlight on macOS. I've tried sample app (Pictures from WWDC Core Spotlight topic) and it does not work (10.13 beta 3, XCode 9 beta 3). The app is running but no search results appear in Spotlight. Same issue with Quick Look preview (no results). Seems like indexing is not working. Thanks in advance.
15
0
6.9k
Dec ’21
mdfind - Disable debug output: [UserQueryParser] Loading keywords and predicates for locale "de_CH"
Hey Whenever I run mdfind, it prints some annoying debug output. Example: $ mdfind …………… 2023-04-24 07:21:53.046 mdfind[642:1948002] [UserQueryParser] Loading keywords and predicates for locale "de_CH" 2023-04-24 07:21:53.047 mdfind[642:1948002] [UserQueryParser] Loading keywords and predicates for locale "de" … That's on macOS Ventura 13.3.1 (22E261). I've got another mac with an older macOS, and there mdfind didn't do this. While googling, I found a post on reddit with a "solution", which just filters out those lines from stderr, like so: function mdfind() { /usr/bin/mdfind $@ 2&gt; &gt;(grep --invert-match ' \[UserQueryParser\] ' &gt;&amp;2) } This does not solve the problem, it just hides it. Is there a way to turn off these debug messages? Thanks, Alexander
Replies
1
Boosts
1
Views
1.8k
Activity
Apr ’23
App Search API Validation Tool is down
The "Search for Developers" website (https://developer.apple.com/ios/search/) references the App Search API Validation Tool located at https://developer.apple.com/ios/search/. Clicking the link returns an SSL error. The entire subdomain returns this same error (https://search.developer.apple.com).I reported it through Apple's developer feedback, who told me to file a Radar. I filed a Radar and it came back as "could not reproduce."Can anyone else confirm that this site won't load? Perhaps Apple doesn't experience the SSL issue from within its own network?I need to use the validator!
Replies
18
Boosts
0
Views
9.2k
Activity
Feb ’23
spotlight/metadata searches are confusing me
In order to set up an asynchronous query looking for a specific application, I have a predicate of:         NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%K LIKE[cd] %@ AND %K = %@",                                                          @"kMDItemDisplayName", name,                                                          @"kMDItemContentType", UTTypeApplicationBundle.identifier]; I tested it with standalone code, and this did what I wanted -- finding applications with the given name. But recently, it seems to have stopped working. That query should be the equivalent of mdfind 'kMDItemDisplayName LIKE[cd] "Safari" AND kMDItemContentType == "com.apple.application-bundle"' but that gives me Failed to create query for 'kMDItemDisplayName LIKE[cd] "Safari" AND kMDItemContentType == "com.apple.application-bundle"'. If I drop the compound, and just do % mdfind 'kMDItemDisplayName LIKE[cd] "Safari"' then I get no output: % mdfind 'kMDItemDisplayName LIKE[cd] "Safari"' %  And yet clearly I do have Safari installed on my system. What am I doing wrong, or missing? Anyone?
Replies
3
Boosts
0
Views
1.6k
Activity
Jan ’23
NSMetadataQueryDidFinishGathering not being called enough
I have an app where each item in an NSTableView contains an NSMetadataQuery, to listen for updates to image files that contain the keyword associated with the item. If I write the keywords to, RAW files, everything works as expected and the number label in the row gets updated correctly. However, if I write the keywords to XMP sidecar files, the NSMetadataQueryDidFinishGathering callback isn't called enough times and the count of files affected isn't updated correctly. What is more, the number returned on the final call to the callback seems to vary depending on the time of day, weather, etc Here is the code that I have used to create the predicate for finding keywords in XMP files…       let xmpFileTypePredicate = NSPredicate(fromMetadataQueryString: "kMDItemKind = \"XMP sidecar*\"cdwt")!       let xmpKeywordPredicate = NSPredicate(fromMetadataQueryString: "kMDItemTextContent = \"<rdf:li>\(keyword)</rdf:li>\"cdw")!       let xmpKeywordsMetadataQueryPredicate = NSCompoundPredicate(andPredicateWithSubpredicates: [xmpFileTypePredicate, xmpKeywordPredicate]) Can anyone give me any ideas?
Replies
0
Boosts
0
Views
1.1k
Activity
Aug ’22
Doing an MDQuery for kMDItemFSName or kMDItemPath doesn't work as I'd expect?
Specifically, it doesn't find anything. (Now, this isn't a huge deal, I was just playing with some queries related to another issue I had, and found that I couldn't search that way.) Is this expected? eg, mdfind 'kMDItemFSName == "/"' finds nothing.
Replies
1
Boosts
0
Views
1.3k
Activity
Aug ’22
Outlook for Mac search feature not working after migration
I migrated from MacBook air 2017 to MacBook air M2 2022. Outlook for Mac launched just fine. Tried to search for an email and came up no results. Using Office 365. Excel and Word search works just fine. Please help.
Replies
1
Boosts
0
Views
1.5k
Activity
Aug ’22
Choose a different iOS app name for Spotlight
I have an app with display name mytest and I'm using the same name for the App Store, I need is to show the app on spotlight search once user try to search for test word. I dont need to use CoreSpotlight framework since its dosn't show the app under Apps section
Replies
2
Boosts
0
Views
1.2k
Activity
Aug ’22
Spotlight not running with norwegian language MacOS ventura beta 5
Hi, I upgraded to MacOS 13 beta 5 and iOS 16 beta yesterday. I noticed that the spotlight service is not running with norwegian language and region. When I change to english (us), it works. Spotlight seems to work on iOS so maybe thw norwegian Spotlight isn’t ready yet?
Replies
2
Boosts
3
Views
1.4k
Activity
Aug ’22
How to manually trigger a CSImportExtension call?
I created an ImportExtension using the template in Xcode, and implemented the -[ImportExtension updateAttributes:forFileAtURL:error:] method. I have tried searching for the corresponding file in Spotlight and the method is not called. How can I make this method be called? Xcode Version: 13.2.1 iOS Version: iOS 15.2
Replies
1
Boosts
1
Views
1.3k
Activity
Aug ’22
Get notified when a new application is installed?
Is there a way to get a notification of some type when a new application is installed? The specifics here have to do with "Here is a list of applications we want to monitor"; I use mdquery to find them (so I can get the paths, and information from the bundle). However, if it's not installed yet, then I can't do that. But if it gets installed later, I'd like to.
Replies
6
Boosts
0
Views
2.3k
Activity
Aug ’22
How do I get information on messages that have been sent in Messages app in iOS?
I have wondered before how I can find out what messages have been sent and perhaps even to whom and from whom. What is the underlying technology behind the search feature in iOS when the user swipes right from the first screen of the home screen? Is that part of Siri. Setting group Siri and Search together. Does the search feature I speak of use Intents, and is that made accessible to developers. I have also noticed that there is an intent property to the extension context object that passes information between a host app and another app's share extension. I'm brainstorming and looking for any ideas. I hope someone out there have good information for me. macOS has Spotlight. Is that available on iOS?
Replies
0
Boosts
0
Views
1.2k
Activity
Jul ’22
Monitor progress of ubiquitous item downloads in iCloud Drive
I'm struggling to find a way to monitor the progress (in percent, or bytes) of a download from iCloud Drive. I.e. files outside of the app's ubiquitous document folder. Our app provides a directory browser (which is accessed using a security scoped bookmark granted by the user). In this browser we want to enable users to download files from iCloud analogous to the user experience provided in Files.app. It seems that NSMetaDataQuery would be the right way to go nowadays. However i don't get any results for queries outside of my own app container. I suppose that's a permission problem? Luckily we can get most of what we need using url's resource values. Also initiating and canceling a download works using NSFileManager. However i found now suitable way of determining a download's progress. NSURLUbiquitousItemPercentDownloadedKey is deprecated and doesn't give any results. Did i overlook something? Is there a way to get NSMetaDataQuery working with security scoped bookmarks to folders?
Replies
0
Boosts
1
Views
1.4k
Activity
Jul ’22
How to integrate with iOS Spotlight contact search?
How to make your app show up in Spotlight’s video call option under contact search? As shown in the attached screenshot. Any tutorial is appreciated.
Replies
0
Boosts
0
Views
860
Activity
Jul ’22
Why does spotlight hate me?
This query should find everything with a display name of "Safari." That should include, for example, /Applications/Safari.app. [bigbook:/tmp] sef% mdfind 'kMDItemDisplayName == "Safari"c' /Library/Application Support/Apple/Safari /Library/Apple/System/Library/Assistant/Plugins/Safari.assistantBundle/Contents/MacOS/Safari /Users/Shared/Previously Relocated Items 1/Security/System/Library/AssetsV2/com_apple_MobileAsset_MacSoftwareUpdate/f7b05c91052116c046919f72de2c03a86cabcf3e.asset/AssetData/payloadv2/ecc_data/System/Library/Templates/Data/Applications/Safari.app /Users/Shared/Previously Relocated Items/Security/Developer/SDKs/MacOSX10.6.sdk/System/Library/PrivateFrameworks/Safari.framework/Versions/A/Safari /Users/Shared/Previously Relocated Items/Security/Developer/SDKs/MacOSX10.7.sdk/System/Library/PrivateFrameworks/Safari.framework/Versions/A/Safari /Users/sef/Applications/Microsoft Office 2004/Office/Themes/safari /Users/sef/Library/Application Support/SyncService/LastSync Data/Safari And yet, /Applications/Safari.app is in fact missing from there. Why? (This used to work. But then mds was broken on my machine, so I bit the bullet and upgraded to Monterey. Multiple Monterey systems are showing this weird behaviour.)
Replies
1
Boosts
0
Views
831
Activity
Jun ’22
Spotlight importer: which key/value to make a file UTI seen as a "Spreadsheet" and not as "Other"
On my spreadsheet application, with its own UTI, I wrote a Spotlight importer plugin. It works well, except that Spotlight group the found files as "Other" and not as "Spreadsheet". My UTI conforms to public.spreadsheet. Any idea? Is there a special kMDxxx key/value to set for that in the importer?(see: https://developer.apple.com/library/archive/documentation/CoreServices/Reference/MetadataAttributesRef/Reference/CommonAttrs.html ) Thanks!
Replies
0
Boosts
0
Views
1.1k
Activity
Jun ’22
trying to figure out where to get a link for "search [query] in App Store"
I'm trying to create a quicklink/command (for personal purposes Raycast) that basically opens the App Store and searches input. I don't know much about developing/backend/code stuff but considering it's easy to create a command that searches other browsers, engines, databases I figure there has to be a way. Hoping this isn't like reddit where someone asks a question and everyone answers it condescendingly or sarcastically just because, reddit.
Replies
1
Boosts
1
Views
997
Activity
Jun ’22
Spotlight indexing cache files
I can see a couple of python scripts in indexing folders /System/Volumes/Data/.Spotlight-V100/Store-V2/<GUID>/Cache/0000/0003/0003/12885148578.txt Why is the spotlight keeping copies of the files in addition to the indexing metadata? Are these temporary files and would these be auto-deleted after some known time period?
Replies
0
Boosts
0
Views
1.2k
Activity
Apr ’22
Track traffic that comes from spotlight or app deeplinking
Hi girls &amp; guys!I wonder if I can track traffic that comes from Spotlight or other app deeplinking launches in my analytics.When Spotlight opens my app with a deeplink, can I provide an argument that differs when the user comes from Spotlight or Safari search or opens my url via another way? Reason is: Currently I get traffic to my mobile page via Google. On my page I take the HTTP referrer and know it's SEO-traffic from Google. For SEA Adwords traffic I specify another URL. Means, I can identify my traffic sources.When Spotlight will take over this search part, there will me no HTTP referrer I can take. I then cannot identify if the user comes from Spotlight Search or another app launch way (e.g. smart app banner).Hope somebody has ideas to specify different arguments for sources when deeplinking to an app.Best regards
Replies
3
Boosts
0
Views
2.7k
Activity
Apr ’22
kMDItemDisplayName doesn't do case-insensitive queries?
Consider: sef% mdfind 'kMDItemDisplayName =[c] "Zoom.us"' sef% sef% mdfind 'kMDItemDisplayName =[c] "zoom.us"' sef% vs sef% mdfind 'kMDItemDisplayName == "zoom.us"' /Applications/zoom.us.app (Using '==' vs '=' doesn't seem to make a difference.)
Replies
2
Boosts
0
Views
1k
Activity
Mar ’22
Core Spotlight does not work on macOS.
Hi, guys.I have an issue with Core Spotlight on macOS. I've tried sample app (Pictures from WWDC Core Spotlight topic) and it does not work (10.13 beta 3, XCode 9 beta 3). The app is running but no search results appear in Spotlight. Same issue with Quick Look preview (no results). Seems like indexing is not working. Thanks in advance.
Replies
15
Boosts
0
Views
6.9k
Activity
Dec ’21