$ osascript -e "id of app \"Finder\""
com.apple.finder
$ bundle=$(mdfind 'kMDItemKind==Application' | grep -i "/Finder.app$" | head -1)
$ defaults read "$bundle/Contents/Info" CFBundleIdentifier
com.apple.finder
Both are fairly slow (about 0.05-0.2s on my Air). Are there any faster or less hacky options?
defaults readseems like the right way to do it (or else querying LaunchServices via Obj-C) - why do you consider 0.1s slow? – Asmus Oct 16 '11 at 22:15