Treat folders with an extension like .service as regular folders instead of bundles in Finder

8

1

Is there a way to force Finder to treat a folder named whatever.service as a folder and not a service?

To make it very clear it's easy to recreate my issue. I just created a new folder, rename it to name.service and I can no longer open the folder. Also, the file info does not let me change the kind or choose a different program to open with.

bejumi

Posted 2011-10-24T19:06:03.140

Reputation: 83

1Does Right click (Ctrl-click) and "Show Package Contents" not do what you want? – Doon – 2011-10-24T19:32:22.047

@Doon, Not when we need to use it in an output path for other software. – bejumi – 2011-10-25T13:26:49.107

Answers

3

"Directories with file extensions" (bundles) are a common way on OS X to bundle stuff consisting of multiple files into a single package, such as kernel extensions, iWork files (before iWork 09), iMovie projects, applications, etc.

You usually can edit an application's Info.plist file to remove the definition of the offending bundle it defined — e.g. .theme for iMovie.

As .service is defined for system Services (see e.g. /System/Library/Services — access them from the application menu bar item, then select Services), you'd probably break stuff by removing this definition.

If you're feeling lucky:

Open /System/Library/CoreServices/CoreTypes.bundle/Contents/Info.plist for example using Xcode (after changing the file and directory permissions using chmod in Terminal) and remove the offending entry in the CFBundleDocumentTypes array.

enter image description here

You need admin permissions to do this. I recommend having current backups. It's possible something breaks if this association isn't purely cosmetic.

Daniel Beck

Posted 2011-10-24T19:06:03.140

Reputation: 98 421

seems like a bad practice from macOS - curious why only few are affected by this? – lifeofguenter – 2018-05-23T11:05:38.647

I wonder what disabling them through RCDefaultApp does.

– slhck – 2011-10-24T20:13:03.073

@slhck Run opensnoop and see what happens on your disk when you change that setting. – Daniel Beck – 2011-10-24T20:15:15.627

I tried commenting out the entry in CoreTypes.bundle/Contents/Info.plist, but it didn't affect the way .services are treated by Finder. – Lri – 2011-10-24T21:22:14.643

@Lri Have you updated the Launch Services database as described in the linked topic? I forgot to mention it again here. – Daniel Beck – 2011-10-25T04:41:23.607

@DanielBeck Not the first time, but I tried commenting it out again followed by resetting the LS database. Still no effect. – Lri – 2011-10-25T06:30:54.947

2I should've mentioned this earlier, but both times I tried modifying CoreTypes.bundle/Contents/Info.plist it nearly locked me out of OS X. No graphical applications launched after a normal login. Restoring CoreTypes.bundle from a Time Machine backup appeared to fix it. (I'm still pretty puzzled why that happened — I didn't change the permissions or owner of the Info.plist and shouldn't have invalidated it.) – Lri – 2011-10-25T06:31:44.867

Thanks for the explaination db, and thanks for doing the trial and error Lri. I think I'll change the way I name development folders in the future, that sounds safer. – bejumi – 2011-10-25T13:44:49.860