Jump to content

Searching ".service" files by default?


Recommended Posts

I thought this was kind of peculiar - Alfred seems to search ".service" files by default with only the essentials in the default scope (Preferences/Contacts).

 

Do I have some strange workflow I forgot about? or am I missing something about .service files?

Screen Shot 2022-03-07 at 17.35.58.png

Link to comment

@garyh This file type shouldn't be included in default results.

 

The best place to start is by using the File Troubleshooter, so that you can see what metadata is being returned for that particular file:

https://www.alfredapp.com/help/troubleshooting/indexing/

 

If you share it here, as well as your Default Results preferences (including any file types you've included via the "Advanced..." button in the Default Results prefs) we'll help you work out what's happening :)

 

Cheers,
Vero

Link to comment

Ah, what a cool feature! I didn't know this existed 😃

 

Check direct file metadata...

 Direct metadata available

Display Name: gpg-agent.service
 Other Names: 
Content Type: com.apple.service-application
   Last Used: 

-----------------------------------------------------------

Check mdls file metadata...

 Metadata contains required items

_kMDItemDisplayNameWithExtensions      = "gpg-agent.service"
kMDItemContentCreationDate             = 2021-12-20 21:20:48 +0000
kMDItemContentCreationDate_Ranking     = 2021-12-20 00:00:00 +0000
kMDItemContentModificationDate         = 2021-12-20 21:20:48 +0000
kMDItemContentModificationDate_Ranking = 2021-12-20 00:00:00 +0000
kMDItemContentType                     = "com.apple.service-application"
kMDItemContentTypeTree                 = (
    "com.apple.service-application",
    "com.apple.application-bundle",
    "com.apple.application",
    "public.executable",
    "com.apple.localizable-name-bundle",
    "com.apple.bundle",
    "public.directory",
    "public.item",
    "com.apple.package"
)
kMDItemDateAdded                       = 2022-03-02 16:39:00 +0000
kMDItemDateAdded_Ranking               = 2022-03-02 00:00:00 +0000
kMDItemDisplayName                     = "gpg-agent.service"
kMDItemDocumentIdentifier              = 0
kMDItemFSContentChangeDate             = 2021-12-20 21:20:48 +0000
kMDItemFSCreationDate                  = 2021-12-20 21:20:48 +0000
kMDItemFSCreatorCode                   = ""
kMDItemFSFinderFlags                   = 0
kMDItemFSHasCustomIcon                 = (null)
kMDItemFSInvisible                     = 0
kMDItemFSIsExtensionHidden             = 0
kMDItemFSIsStationery                  = (null)
kMDItemFSLabel                         = 0
kMDItemFSName                          = "gpg-agent.service"
kMDItemFSNodeCount                     = (null)
kMDItemFSOwnerGroupID                  = 80
kMDItemFSOwnerUserID                   = 501
kMDItemFSSize                          = 223
kMDItemFSTypeCode                      = ""
kMDItemInterestingDate_Ranking         = 2021-12-20 00:00:00 +0000
kMDItemKind                            = "Application"
kMDItemLogicalSize                     = 223
kMDItemPhysicalSize                    = 4096
kMDItemSupportFileType                 = (
    MDSystemFile
)

 

It looks like Finder/macOS thinks this is an application based on "kMDItemKind"? 🤔

 

My default results are just "Applications, Preferences, Contacts"

Link to comment
6 hours ago, Vero said:

@garyh Can you please provide the full output from the troubleshooter?

 

Cheers,
Vero

 

Sure thing!

 

Starting Diagnostics...

File: 'gpg-agent.service'
Path: '/usr/local/Cellar/gnupg/2.3.4/share/doc/gnupg/examples/systemd-user'

-----------------------------------------------------------

Check file cache database...

 File cache integrity is ok

-----------------------------------------------------------

Check if file is readable...

 Alfred has permissions to read this file.

-----------------------------------------------------------

Check if volume '/' is indexed by macOS...

 Indexing is enabled on this drive

-----------------------------------------------------------

Check direct file metadata...

 Direct metadata available

Display Name: gpg-agent.service
 Other Names: 
Content Type: com.apple.service-application
   Last Used: 

-----------------------------------------------------------

Check mdls file metadata...

 Metadata contains required items

_kMDItemDisplayNameWithExtensions      = "gpg-agent.service"
kMDItemContentCreationDate             = 2021-12-20 21:20:48 +0000
kMDItemContentCreationDate_Ranking     = 2021-12-20 00:00:00 +0000
kMDItemContentModificationDate         = 2021-12-20 21:20:48 +0000
kMDItemContentModificationDate_Ranking = 2021-12-20 00:00:00 +0000
kMDItemContentType                     = "com.apple.service-application"
kMDItemContentTypeTree                 = (
    "com.apple.service-application",
    "com.apple.application-bundle",
    "com.apple.application",
    "public.executable",
    "com.apple.localizable-name-bundle",
    "com.apple.bundle",
    "public.directory",
    "public.item",
    "com.apple.package"
)
kMDItemDateAdded                       = 2022-03-02 16:39:00 +0000
kMDItemDateAdded_Ranking               = 2022-03-02 00:00:00 +0000
kMDItemDisplayName                     = "gpg-agent.service"
kMDItemDocumentIdentifier              = 0
kMDItemFSContentChangeDate             = 2021-12-20 21:20:48 +0000
kMDItemFSCreationDate                  = 2021-12-20 21:20:48 +0000
kMDItemFSCreatorCode                   = ""
kMDItemFSFinderFlags                   = 0
kMDItemFSHasCustomIcon                 = (null)
kMDItemFSInvisible                     = 0
kMDItemFSIsExtensionHidden             = 0
kMDItemFSIsStationery                  = (null)
kMDItemFSLabel                         = 0
kMDItemFSName                          = "gpg-agent.service"
kMDItemFSNodeCount                     = (null)
kMDItemFSOwnerGroupID                  = 80
kMDItemFSOwnerUserID                   = 501
kMDItemFSSize                          = 223
kMDItemFSTypeCode                      = ""
kMDItemInterestingDate_Ranking         = 2021-12-20 00:00:00 +0000
kMDItemKind                            = "Application"
kMDItemLogicalSize                     = 223
kMDItemPhysicalSize                    = 4096
kMDItemSupportFileType                 = (
    MDSystemFile
)

-----------------------------------------------------------

Check file is in search scope...

 File exists within Alfred's default search scope

-----------------------------------------------------------

 Troubleshooting passed

 

Link to comment

@garyh Thanks for providing more details.

 

I'm not familiar with .service files, are they normally considered apps in macOS? If so, what's happening is that macOS is just treating the .service files as apps (as you can see from the ContentTypeTree) and including them in your results.

 

You have a few options:

- You can exclude the single .service app by dragging it to Spotlight's Privacy tab. You should then type "reload" into Alfred to refresh the application cache and remove it

- You could exclude an entire folder within Cellar if these results are not relevant and/or there are multiple .service files showing in your results. Again, clear cache after adding them to Spotlight Privacy

- If .service files aren't supposed to be apps, you'll need to do a little research to work out how to correct the type

 

Hope this helps :)

Link to comment
  • 4 months later...
On 3/12/2022 at 12:34 AM, garyh said:

Thanks @Vero! I think these are not supposed to be Applications (they're part of homebrew packages for macOS) so I'll have to figure out something with #3 since they seem to be everywhere :) 

 

Has the problem been solved? I've had this problem for a long time

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...