0

My Delphi Firemonkey MacOS app makes documents with a .4MD extension.

How can I get my app to launch when the user double clicks on Finder documents with a .4MD extension?

The seemingly duplicate question on Stackoverflow has an answer with a dead link to Apple's documentation.

This article has answers for Delphi XE2: https://delphihaven.wordpress.com/2012/08/14/associating-a-file-type-on-osx-part3/

Mike at Bookup
  • 1,211
  • 14
  • 32
  • I've checked out the possible duplicate answers. Best I can tell, the links in those answers point to missing pages in Apple documentation. I could use some help with the actual steps in Delphi, possibly involving adding LSItemContentTypes to the info.plist. – Mike at Bookup Jan 11 '17 at 20:27
  • 1
    Try these articles [Associating a file type with a FMX/OS X application (1) – background](https://delphihaven.wordpress.com/2012/08/10/associating-a-file-type-on-osx-part1/), [Associating a file type with a FMX/OS X application (2) – making the associations](https://delphihaven.wordpress.com/2012/08/12/associating-a-file-type-on-osx-part2/) – RRUZ Jan 11 '17 at 20:33
  • This doesn't feel like something you do by writing delphi code. – David Heffernan Jan 11 '17 at 20:35
  • @RRUZ Thanks. That link seems to address all the problems - but for Delphi XE2. I'll see if I can adapt it to Delphi Berlin. – Mike at Bookup Jan 11 '17 at 20:52
  • @DavidHeffernan While it may not feel like something one does by writing code in Delphi, there almost certainly must be some code added to a Delphi app that reacts when MacOS requests that the Delphi app open a docment that was double clicked in the Finder. – Mike at Bookup Jan 11 '17 at 20:58
  • @Mike: Um, yes. It accepts the filename it receives as a parameter and opens it, just like it would in Windows or any other OS. See ParamCount and ParamStr in the documentation. – Ken White Jan 11 '17 at 21:57
  • @KenWhite I'm not understanding completely. If my app is already running and a user double clicks on one of my app's documents in the Finder, how does my app know to check the (presumably magically updated) ParamStr? – Mike at Bookup Jan 12 '17 at 22:14

0 Answers0