Standard apps usually just need the name, like Finder and Safari but you can also specify the path "/Applications/DifferentFinder.app"
Standard apps usually just need the name, like Finder and Safari but you can also specify the path "/Applications/DifferentFinder.app"
It is just the first time the .DS_Store file is needed is often when the folder is touched by Finder.
I guess you could do that centrally with some sort of database but that would open another can of worms; and most importantly you wouldn't be able to transfer a folder and keep its Finder presentation intact.
Nowadays it's not as useful because of the App Store but when software was only released as .dmg images, it became expected to open a nice layout with graphics presenting the app and a shortcut to the App folder that you would drag'n'drop the app bundle to.
This presentation relies of .DS_Store to work.
There are some other use cases like that, it all comes down to a simple fact: Apple has always cared a lot more about how things look than Microsoft ever did, this is a perfect example.
Of course, they could rethink the whole thing but the point is that it's a legacy thing and at this time it's not worth dedicating much ressource to a solve problem just to remove some mostly invisible files (on UNIXs). It's really easy to have scripts to cleanup for sharing to outside world, even some zip utilities do that automatically.
It can be annoying but it's really not a big deal, I doubt they could come up with something much better while still preserving the functionality and not making another complicated/convoluted proprietary folder format that wouldn't transfer any better to Windows...
open -b com.sublimetext.4 file.txt
I prefer this vs using the App Name or Path, since those can vary depending on the system or app version. The bundle ID is more robust. open .
unless you've reconfigured something else to open directories, which most people haven't.