[racket] application-file-handler problem on OS X
Hi all,
I have a problem getting application-file-handler to work as I would
have expected on OS X 10.7 ("Lion"). This seems to be a bug/misfeature.
The problem is that when a file of the right file type is opened by
double-clicking it in the Finder, the application does not receive it as
a command line argument but instead application-file-handler is called
much later. Consequently, I cannot reliably detect whether a file has
been provided or not during application startup; my default handler
(open new document) is called and only afterward the
application-file-handler is triggered.
The only workaround I can think of right now is to delay the default
handler for several seconds and use a global flag/parameter to check
whether some files have been opened. However, this would unnecessarily
increase ordinary application startup time.
Does anyone have a better suggestion? Is this a bug/misfeature? Is there
a way to test for available files during application start before
application-file-handler is called?
Best,
Erich