moretension / duti

A command-line tool to select default applications for document types and URL schemes on Mac OS X
Other
1.41k stars 66 forks source link

[FEATURE] Additional option to get list of bundle ids AND their paths for a given UTTypeIdentifier #57

Open pskowronek opened 2 months ago

pskowronek commented 2 months ago

It would be nice to have additional parameter to list not only bundles ids for a type identifier but also their paths.

For example, in muCommander I had to used mdfind to get the path for a given bundle id - this is additional call just to get the path of an application (kinda related to bug here: https://github.com/mucommander/mucommander/issues/1162). The path is needed to: a) invoke an app for a given file, b) to display its icon. Calling mdfind adds additional delay (ok, we cache the results, but still), but it uses spotlight (some people turn it off, especially if they get annoyed by spotlight indexing external drives).

So, for example now duti -l public.jpeg produces:

org.photoscape.PhotoScapeX
com.apple.Preview
[...]

What about if there was for example -L to produce:

org.photoscape.PhotoScapeX: /Applications/PhotoScape X.app
com.apple.Preview: /Applications/Preview.app
[...]

Of course the parameter name and the output is just a suggestion. I know that duti is able to return paths when using -x but only for a default app.

Additionally :) - in muC we have to run duti -e jpg to get public.jpeg, then we need to run duti -l public.jpeg - it would be also nice for -l (or hopefully -L) to accept also extensions, for example: duti -l .jpg - anything prefixed with a dot could be then considered as an extension and all the hard lifting done internally by duti and therefore lowering the number of calls to duti and making muC more responsive :)