If I understand you correctly, I think you can do it by adding some conditional (Mac-only) code to your main form. For example:
In your declaration of event handlers:
{$IFDEF DARWIN}
procedure DropFiles( Sender : TObject;
const FileNames: array of string);
{$ENDIF}
Then in FormCreate or some other startup routine:
{$IFDEF DARWIN}
OnDropFiles := DropFiles;
{$ENDIF}
Then the implementation. (In this example, LoadFile and SetFormData are additional methods specific to my app.)
{$IFDEF DARWIN}
procedure TMainForm.DropFiles( Sender : TObject;
const FileNames : array of string);
{When start app by double-clicking a file,
file name passed to this event handler.}
begin
if High(FileNames) >= 0 then {At least one file passed?}
begin
if LoadFile(FileNames[0]) then {Opened first file okay?}
SetFormData;
end;
end;
{$ENDIF}
One other thing you can do to activate the ability of Finder to start your app and "drop" a double-clicked file on it (thereby opening the file), is to set the CFBundleDocumentTypes key in your app bundle's (.app folder) Info.plist file, thereby associating a document type (extension) with your app. Let me know if you have questions about this or see Apple's docs:
http://developer.apple.com/library/mac/documentation/General/Reference/InfoPlistKeyReference/Introduction/Introduction.html#//apple_ref/doc/uid/TP40009247Thanks.
-Phil