'Open with' finder context menu: how to add one's app for any filetype?

I have an information management app with archiving and document storage capabilities.

I would like it to appear in the ‘open with’ list of Finder, for any file type. How do I achieve this?

If you have a FileType declared with .docx as the extension in your app, it should show up.

This answer may be in flux (like it’s now UTI) and I may be wrong, but that always HAS been the case. File “associations” on Mac are always handled by the OS and it makes it’s own decisions about such things, but I do believe that if your app says “hey, I deal with this extension (which nowadays essentially determines the filetype), OS, could you please put me in line to handle this app?”

I know how to do it for a specific file type, but for ANY?

There’s a UTI for that (public.content at the very worst)
see https://developer.apple.com/library/ios/documentation/Miscellaneous/Reference/UTIRef/UTIRef.pdf

use an universal type like public.item?

Are you saying that you want your app to show up on ANY file, so it’s ALWAYS on there?

If so, okay, but to ask everyone else, is that being a good Mac neighbor?

https://developer.apple.com/library/ios/qa/qa1587/_index.html

[quote=177647:@Garth Hjelte]Are you saying that you want your app to show up on ANY file, so it’s ALWAYS on there?

If so, okay, but to ask everyone else, is that being a good Mac neighbor?[/quote]

It is an ARCHIVING solution which allows to save away any file the user wants, plus add references to other pieces of information like contacts, events and general information to a database. So yes, it is meant to be ALWAYS there, once the user installed it.

Have you actually read my post above?

You could create a service with Automator, then you’ve got it in the Services menu.

something like this

(open it with Automator, change the app to your app, and change the name…)

Hello Axel, this works nicely.

I wonder if there is a way to easily install it as a service from my app … the app is sandboxed.

Thanks!

slightly off topic…

How do you MANAGE that list (ie keep things OFF of it?)

I found a terminal command to wipe it out, but things creep back on it…
For example, EVERY version of RealBasic, RealStudio and XOJO appear,

[quote=177676:@Dave S]slightly off topic…

How do you MANAGE that list (ie keep things OFF of it?)

I found a terminal command to wipe it out, but things creep back on it…
For example, EVERY version of RealBasic, RealStudio and XOJO appear,[/quote]

From time to time I run this AppleScript to reset the ‘Open with’ list and eliminate duplicate entries:

do shell script "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user"

See also: http://ss64.com/osx/lsregister.html

I have not looked for other ways to maintain that list.

If the app’s plist states it can open a document type then launch services will list it
Short of altering the apps plist to remove the UTI entries I’m not aware of a way to have launch services NOT do this

MBS Plugin comes with examples for offering services which appear in the contextual menus.
One example for Cocoa and and older one for Carbon apps.

[quote=177688:@Christian Schmitz]MBS Plugin comes with examples for offering services which appear in the contextual menus.
One example for Cocoa and and older one for Carbon apps.[/quote]
Found it, thanks!