0

What is the technical name of the following file-open capabilities of macOS programs?

  • open a file that is dragged from the Finder onto the applications’s dock icon
  • open a file from the "Open with" Finder dialog in a specific application
  • open a file that is "sent to" the application by a third party application like LaunchBar?
1
  • Also right-clicking on the file and selecting “open with”... – Solar Mike Nov 8 '20 at 19:33
1

In all instances, it's called "opening a file." macOS (like other operating systems including Windows and Linux) support multiple methods of opening a file.

  • Drag and Drop is supported throughout the OS. If you drag and drop a file onto another graphical element, it will (attempt to) open that file within the context of that element. If it's a folder, Finder will open that folder to accept the file. If it's an application, it will open that application with that file (as input).

  • Open With is just an alternative to the default action of "Open" in Finder which uses the file's default associated application. This allows you to select from alternates registered with macOS or manually select an app.

  • A 3rd party app does the same thing by opening a file with it's associated default or alternate application. There's no different method of opening files as already provided for by the OS.

The applications associated with different file types are registered in LaunchServices. So a PDF might be associated with Preview or Adobe Acrobat Reader. LaunchServices will have those relationships established within it's database. This is how "Open With..." is populated with alternate apps.

From a command line perspective, this is how you can have a .doc or .docx file automatically be opened by Word, for example when typing

% open foobar.doc

But then, if you want to open it with Pages, you can issue the command

% open -a Pages foobar.doc

You can also launch the application and specify the file as a "command line argument" even for a file that's not even associated with an app (you wouldn't use a browser to view text files even though it is supported).

% /Applications/Firefox.app/Contents/MacOS/firefox ~/Desktop/foobar.txt
5
  • Thanks for your answer. For clarification: When two applications are processing e.g. jpeg files and one provides all the ways to open a file and the other doesn‘t - what is the technical difference? You have to enable/disable this standard behavior somehow, at least from my narrow perspective. – lejonet Nov 8 '20 at 19:42
  • 1
    It's what was registered in LaunchServices (i.e. Photoshop and Preview) one handles the basics and one does a lot more. It depends on which one you configured to be the default and which one you want to open with using the various methods described above. There's no technical difference between the two - it's how you have the system configured. – Allan Nov 8 '20 at 19:44
  • Also When two applications are processing e.g. jpeg files and one provides all the ways to open a file and the other doesn‘t - this scenario isn't likely to occur. See Apple's Human Interface Guidelines on File Handling – Allan Nov 8 '20 at 19:48
  • @lejonet Looking at Allan's comments here are your responses suggests to me that you should provide an case where things are different so we can see the actual problem you are trying to solve. – mmmmmm Nov 20 '20 at 9:49
  • @mmmmmm ImageOptim provides standard opening possibilities, JPEGmini in comparison doesn’t. I am not trying to solve a problem, but to understand what programmer choices lead to such differences. – lejonet Nov 20 '20 at 13:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .