Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Oneechan69

macrumors regular
Original poster
Mar 29, 2022
212
27
US
I'm trying to ignore the folder /Users/<username>/Applications (Parallels). I looked up other help posts and write the following:

> sudo osxmetadata --set com.apple.metadata:kMDItemFinderComment 'alfred:ignore' -- "/<username>/Applications (Parallels)" Invalid attribute name: com.apple.metadata:kMDItemFinderComment
 

Weaselboy

Moderator
Staff member
Jan 23, 2005
34,147
15,630
California
once you've added the Applications (Parallels) folder to Spotlight Privacy, type "reload" in Alfred to clear his cache. This should do the trick :)


Did you try this suggestion from the dev over on their forums?
 

chown33

Moderator
Staff member
Aug 9, 2009
10,753
8,437
A sea of green
The command-line you gave may have an invalid pathname arg:
Code:
sudo osxmetadata --set com.apple.metadata:kMDItemFinderComment 'alfred:ignore' -- "/<username>/Applications (Parallels)"
Assuming you're using a placeholder convention here, this probably isn't real:
"/<username>/Applications (Parallels)"

The real pathname would more likely be:
"/Users/<username>/Applications (Parallels)"


If an invalid pathname is the problem, I think it's a bug in the tool that it's giving this error:
Invalid attribute name: com.apple.metadata:kMDItemFinderComment
I can sorta understand that distinguishing the two errors (invalid attribute vs. invalid pathname) may be difficult, but it's always possible to qualify whether a pathname exists before attempting an operation on it.
 
Last edited:

gilby101

macrumors 68020
Mar 17, 2010
2,490
1,346
Tasmania
I'm trying to ignore the folder /Users/<username>/Applications (Parallels)

1) Are you trying to ignore the folder or the files within the folder? From my testing Alfred, alfred:ignore Finder Comment attached to a folder does not apply to the items within the folder. If you want to ignore the files inside, you need to specify for each file - not the folder.

2) Finder Comments are notoriously difficult to use consistently. Sometimes they are stored as extended attributes of the object (file or folder), sometimes they are stored in the .DS_Store file in the parent folder. A pity Alfred uses them - but see (7) below.

3) I think the Invalid Attribute Name error is because osxmetadata has problems with that specific metadata (the path was wrong as well). Generally better to use macOS command rather than an added one.

4) So better to use xattr to set the extended attribute, like this:
xattr -w com.apple.metadata:kMDItemFinderComment 'alfred:ignore' <path>
where <path> is the path to the folder or file.

5) And check it is set with:
xattr -l <path>
or
mdls <path>

6) When setting the xattr as in (4) above, Finder sometimes/always (not sure which) does not show it in its Get Info. Related to (2) above.

7) Alfred also recognises alfred:ignore as a Finder Tag. That is easy and reliable to set with Finder's Get Info or Control-click drop down.

8) You have found this workflow - it uses Finder Tags. https://alfred.app/workflows/alfredapp/ignore-in-alfred/
 
Last edited:

Oneechan69

macrumors regular
Original poster
Mar 29, 2022
212
27
US
I got it. It didn't show up at the top when I wrote "Reload" but it was actually at the bottom of the list for some reason. Anyway, that worked and how it shows up at the top when I type "Reload"
CleanShot 2024-03-25 at 08.40.52@2x.png
 
  • Like
Reactions: Weaselboy
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.