Re: Determining how delivered OSX application is launched?
Josh,
For SANLab I've been just using a flag to determine if the application has received the message callback, and if it has, foregoing the creation of an empty model. This seems to work without any issue.
Evan
On Feb 10, 2010, at 5:46 PM, Joshua TAYLOR wrote:
>
> HI all,
>
> I'm delivering a CAPI application on OS X (LWM, 6.0), and I want to
> be drag files onto the application bundle. To do this, I provide a
> message callback to the application interface that can handle an
> :open-file message. This works without a problem, and my application
> can open files as it ought to.
>
> My problem is that I'd like the following behavior:
> --- If the application is opened by double clicking the application
> bundle, or through Spotlight, &c., I'd like to open an "empty"
> document. To date, I've done this by having my delivery function do
> this.
> --- If the application is opened by a document file being
> double-clicked, or by a document being dragged onto the application
> bundle, I'd like to not open the default "empty" document. At the
> moment, the message-callback can handle opening the document, but my
> default "empty" document, of course, still appears.
>
> Anyone know how I can detect whether in which way the application was
> opened, have a workaround, or know how this ought to be done? The
> desired behavior isn't unusual on OS X—TextEdit, e.g., opens a new
> text file by default, but if TextEdit is opened when I double-click a
> text file, TextEdit starts and the only open file is the one on which
> I double clicked.
>
> I seem to recall using the application's command line arguments a
> version or two ago (but I could be mistaken about this), and this
> doesn't seem to be a solution now. (The command line arguments are
> the same for both ways of launching the application.)
>
> Thanks in advance, //JT
>
> --
> Joshua Taylor, http://www.cs.rpi.edu/~tayloj/
>
>
>
> --
> BEGIN-ANTISPAM-VOTING-LINKS
> ------------------------------------------------------
>
> Teach CanIt if this mail (ID 31418092) is spam:
> Spam: http://respite.rpi.edu/b.php?c=s&i=31418092&m=5709d42b161c
> Not spam: http://respite.rpi.edu/b.php?c=n&i=31418092&m=5709d42b161c
> Forget vote: http://respite.rpi.edu/b.php?c=f&i=31418092&m=5709d42b161c
> ------------------------------------------------------
> END-ANTISPAM-VOTING-LINKS
>
>