3

I have a directory, ~/Downloads, which has accidentally become associated with Terminal.app. I would like to remove the association so that the directory can be used with Finder.app again. Thus far, I have investigated extended attributes with xattr, but this isn't the right method to remove associations. How does one fix a problem like this? Please see the illustration below.

This is macOS 10.13.6.

It appears to have been done by copying a Keynote "file" to the directory.

cp -rp file.key/ ~/Downloads/

enter image description here

1 Answer 1

5

Looks like you've set the bundle bit on your folder somehow (visible in the Info window: Kind: Package).
Some applications prefer (or create) a package instead of a folder, which can be double clicked to open a whole library folder in an application (iPhoto for example) and maybe to make it harder for the user to mess with its content(?).
To remove the bit run the following command in Terminal (/Applications/Utilities/Terminal.app, or search in Spotlight):

SetFile -a b ~/Downloads

SetFile is part of the command line tools. Without the command line tools installed, a popup should ask you if you want to download them. Allow this and try again.

Since there were recent issues, downloading the Developer Tools via Terminal, here's a link to the downloads page with search for the command line tools: https://developer.apple.com/download/all/?q=command%20line%20tools

Another way to remove the bundle bit - since it's an extended attribute - would be to remove the FinderInfo attribute:

xattr -d com.apple.FinderInfo ~/Downloads
3
  • 1
    Bingo! Thank you. After reading the help for SetFile, I still would not have been able to deduce myself what to do even if I knew what I had done and which program could undo it. Do you happen to know of a good reference for the SetFile command? Evidently, -a b is merely a toggle switch. Commented Jul 11, 2018 at 12:19
  • 1
    Sorry, apart from man SetFile your internet search is probably just as good as mine. It's deprecated and I can't even find the legacy documentation at the Apple developer site. Commented Jul 11, 2018 at 12:30
  • 2
    Ah! Thank you again. Even though /usr/bin/setfile and /usr/bin/SetFile exist as regular executable files, not links, the man page is case sensitive - not man setfile, but man SetFile - which explains SetFile flawlessly. The program's help is a bit cryptic. Commented Jul 11, 2018 at 12:41

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.