In the comments, you indicated that the problem files were on an external drive. Is it formatted as FAT (or NTFS)?
These filesystems have no concept of executable files, so the system seems to assume that everything is an executable program. Don't worry, there's nothing wrong with the file.
Why does it do this? Well, it's a permissions problem.
To see the permissions on a file, you can open a terminal, type ls -ld
with a space after it, drag in your file, and press Return. The first part of the output will look like this:
-rw-r--r--
So what does all this mean?
r: read w: write x: execute
- rwx rwx rwx
| └─┬─┘ └─┬─┘ └─┬─┘
additional user group world
info perm.s perm.s perm.s
Try this on some file in your home folder. You should get something like rw-r--r--
. Now try something on your external drive—it's probably rwxrwxrwx
.
(External drives usually don't have a concept of ownership, so even on an HFS+-formatted drive you'll get the same set in each field. Edit: I tested this on a random file and it came back with rw-r--r--
. Oops.)
Fixing the problem
The proper way
If the partition the file is on is formatted HFS+ (like your system disk) or any Unix filesystem (e.g. ext4, XFS), then you can use chmod
. To do this, type chmod -x
into a terminal, add a space, and drag in your file, just as with ls
above. Hit Return, and you should be golden.
In fact, this is always worth a shot—it's safe to try on any type of filesystem. If it doesn't work, see below.
The improper way—just hiding it
On filesystems with no concept of executable files, chmod
will silently fail and nothing will happen. You can still hide this by setting an icon. To do this, Get Info on a file (⌘I) and drag a .icns
file onto the icon in the top left corner. (You can also just copy and paste the icon from something else—that's probably the way to go here. If you want a custom icon, read on.)
So, how do you get this mysterious .icns
file?
The easiest way is simply to open an image in Preview, select everything (⌘A), and copy it (⌘C). Then you can just paste it into the corner icon (click to select it first).
But .icns
images have a hidden benefit—they can display differently at different sizes. This is great for app icons, which is their main reason for existence. If you want to make your own image do this, you can do the following:
Slightly off-topic: making your own icon images behave differently at different sizes
- Collect a set of images, with sizes of 64x64 up to 1024x1024. These are for Retina displays, you'll downsize them later. Put them in a folder named
whatever.iconset
.
- Rename each of them to
icon_<halfwidth>x<halfheight>@2x.png
(for example, the 64px icon would be [email protected]
).
- Duplicate each icon, halve its size, and rename it
icon_<newwidth>x<newheight>.png
(for example, icon_32x32.png
). This can be automated with a shell script, using the sips
command (run man sips
for more info on using it).
You'll see that if you Quick Look preview the folder, you'll see your icon, and see how it behaves at different sizes.
- Convert it to a
.icns
with this command: iconutil --convert icns
and drag in your iconset, as with the other commands.
Associating the file type with Firefox
I don't know whether your process would have worked, but you'll need to make sure the system can see the change. You do this with lsregister
:
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister .../Firefox.app
Replace .../Firefox.app
with the path to Firefox, or drag it into the terminal.