Opening File That User Double-Clicked On To Open Your Application

When the user double-clicks on your application file the operating system will launch your application. This lesson shows how to determine what file the user double-clicked on so that you can open it.

Introduction

When configuring your application you can specify what file extensions your application supports. When your application launches the framework looks at any command line parameters or apple events that are sent to your application. Using the list of file extensions you have configured the framework stores all files that are supported in the "command line files" property.

Check "command line files" Property

When your application window opens for the first time (1) you can check if "command line files" has a value (2) and if so then you can attempt to open the file.

Previous Lesson: Adding Database Drivers Table of Contents Next Lesson: Working With Recent Files