Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-12

MacOS X : File Associations...

8 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

Hi all,
I've correctly set up File Associations for my application, but I can't seem to find out which file was actually launched when my application starts.
Is it passed in as the ParamStr(1) or by some other means?

Secondly if I have several version of my application installed on one machine, which I assume means that they are all registered to respond to file associations, how can I tell which one of these applications will be launched? Is there a launch order or similar for file associations? I believe Windows has this ordering type thing for file associations.

Thanks,

Dominique.

Unknown author
to Unknown author

Any ideas?

Show quoted text 17 lines
Hi all, I've correctly set up File Associations for my application, but I can't seem to find out which file was actually launched when my application starts. Is it passed in as the ParamStr(1) or by some other means? Secondly if I have several version of my application installed on one machine, which I assume means that they are all registered to respond to file associations, how can I tell which one of these applications will be launched? Is there a launch order or similar for file associations? I believe Windows has this ordering type thing for file associations. Thanks, Dominique.
Unknown author
to Tom Gregorovic

Hi Tom,
I've just tested this out and if I Drag and Drop the file onto the application dock icon The OnDropFiles event fires, but if I double click the file from within finder, the OnDropFiles event does NOT fire. The Info.plist file correctly contains CFBundleTypeExtensions for gmk and the CFBundleTypeRole is set to Editor.

Am I missing any other setting in the Bundle to fire the OnDropFiles event?

Thanks,

Dominique.

"Tom Gregorovic" wrote
On Sat, Dec 20, 2008 at 12:32 AM,
Show quoted text 11 lines
> Any ideas? > Look at OnDropFiles event of TApplication - http://wiki.lazarus.freepascal.org/Carbon_interface_internals#Application Tom _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Tom Gregorovic
to Unknown author
Show quoted text 9 lines
Hi Tom, I've just tested this out and if I Drag and Drop the file onto the application dock icon The OnDropFiles event fires, but if I double click the file from within finder, the OnDropFiles event does NOT fire. The Info.plist file correctly contains CFBundleTypeExtensions for gmk and the CFBundleTypeRole is set to Editor. Am I missing any other setting in the Bundle to fire the OnDropFiles event?

Try to look at Lazarus application bundle plist. I think this works for it there.

Tom

Unknown author
to Tom Gregorovic

I've compared my plist to the Lazarus's and I can't see anything that would stop it from working from the Finder, but then allows it to work via Drag and Drop. I've attached the file to this email, in case anyone has a few minutes to scan through it and see if there is something obvious I've missed.

Dominique.

"Tom Gregorovic" wrote
On Tue, Jan 13, 2009 at 5:19 PM,
Show quoted text 20 lines
> Hi Tom, > I've just tested this out and if I Drag and Drop the file onto the > application dock icon The OnDropFiles event fires, but if I double click > the file from within finder, the OnDropFiles event does NOT fire. The > Info.plist file correctly contains CFBundleTypeExtensions for gmk and the > CFBundleTypeRole is set to Editor. > > Am I missing any other setting in the Bundle to fire the OnDropFiles event? > Try to look at Lazarus application bundle plist. I think this works for it there. Tom _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Info.plist
Type: application/octet-stream
Size: 1446 bytes
Desc: not available
Url : http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090114/4520272a/attachment.obj

Unknown author
to Unknown author

After further testing it seems that the onDropFiles event correctly fires via both Drag/Drop and if you double click a file while the exe is running. The only scenario where OnDropFiles does not fire is if the app is not running and someone double clicks an associated file. In that scenario the command line ParamStr(1) contains some sort of ID.

Does anyone have any other suggestions?

Dominique.

I've compared my plist to the Lazarus's and I can't see anything that

would

Show quoted text 32 lines
stop it from working from the Finder, but then allows it to work via Drag and Drop. I've attached the file to this email, in case anyone has a few minutes to scan through it and see if there is something obvious I've missed. Dominique. On Wed, 14 Jan 2009 13:09:16 +0100, "Tom Gregorovic" wrote: > On Tue, Jan 13, 2009 at 5:19 PM, wrote: >> Hi Tom, >> I've just tested this out and if I Drag and Drop the file onto the >> application dock icon The OnDropFiles event fires, but if I double click >> the file from within finder, the OnDropFiles event does NOT fire. The >> Info.plist file correctly contains CFBundleTypeExtensions for gmk and > the >> CFBundleTypeRole is set to Editor. >> >> Am I missing any other setting in the Bundle to fire the OnDropFiles > event? >> > > Try to look at Lazarus application bundle plist. I think this works > for it there. > > Tom > _______________________________________________ > Lazarus mailing list > > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus