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

Is it possible to use duti with path executable instead of bundle ID? #18

Open extempl opened 8 years ago

extempl commented 8 years ago

I need this in terms of creating some proxy file which should parse provided string and open some application with correct data.

peng051410 commented 5 years ago

+1

phlind commented 3 years ago

+1

haakonstorm commented 3 years ago

I'm not sure if this is even directly possible, as it appears UTIs and bundle IDs are the way to (indirectly) go?

Perhaps this one-liner can be of value to someone looking for the same as I did:

function app2bundleid { readonly local PLIST="${1}/Contents/Info.plist"; [ -e $1 ] && /usr/libexec/PlistBuddy -c 'print ":CFBundleIdentifier"' ${PLIST} || echo file not found. }

(for readability:)

function app2bundleid { 
  readonly local PLIST="${1}/Contents/Info.plist"
  [ -e $1 ] && /usr/libexec/PlistBuddy -c 'print ":CFBundleIdentifier"' ${PLIST} || echo file not found. 
}
Screenshot of iTerm2 (07-03-2021, 13-46-18)