Open application when file double clicked

Richard Gaskin ambassador at fourthworld.com
Tue Feb 24 18:30:35 EST 2015


Even weirder:

Offlist Bernd kindly sent an example of a stack similar to what's 
described below, but it works flawlessly.

The only significant difference I could find was that his uses a custom 
document type, while I had use txt.

So I went back to my test app, changed the document type from txt to a 
custom one, and now I get the odoc events both when files are dropped on 
the app to launch it and while the app is already running.

This seems like a bug in the Finder more than LiveCode, some oddity in 
how AE works with well known file types.

Since there doesn't appear to be any problem at all, I'm closing my bug 
report.

And since there doesn't appear to be any problem at all, how did we wind 
up here?

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com


>
> Wierdness abounds:
>
> I made a standalone with this card script:
>
> on startup
>     insert script of btn "fs" into front
> end startup
>
>
> This script in a button "fs":
>
> on appleEvent
>     put the params &cr & the executionContexts &cr&cr after fld 1
>     pass appleEvent
> end appleEvent
>
> And that same script in the stack.
>
> When I double-click the resulting app, I see:
>
> appleEvent "aevt","oapp",""
> button id 1007 of card id 1002 of stack "/Users/rg/Desktop/ae tester/ae
> tester/ae tester.app/Contents/MacOS/ae tester",appleEvent,2
>
> appleEvent "aevt","oapp",""
> stack "/Users/rg/Desktop/ae tester/ae tester/ae
> tester.app/Contents/MacOS/ae tester",appleEvent,2
>
>
> When I launch the app by dropping a text file onto it (I'd set it up to
> use TEXT/txt files) I get:
>
> appleEvent "aevt","odoc",""
> button id 1007 of card id 1002 of stack "/Users/rg/Desktop/ae tester/ae
> tester/ae tester copy.app/Contents/MacOS/ae tester",appleEvent,2
>
> appleEvent "aevt","odoc",""
> stack "/Users/rg/Desktop/ae tester/ae tester/ae tester
> copy.app/Contents/MacOS/ae tester",appleEvent,2
>
> But I get no oapp when I launch the app with a document, and I get no
> odoc when I launch the app without one.
>
> I've searched the LC scripts and this issue is different from the older
> one I'd experienced, since the other one was consistent and caused by a
> rev script.
>
> This one appears to be engine-level, in which only the first Apple event
> is processed, and subsequent ones ignored.
>
> Can anyone confirm this before I update my bug report?
>
> --
>   Richard Gaskin
>   Fourth World Systems
>   Software Design and Development for the Desktop, Mobile, and the Web
>   ____________________________________________________________________
>   Ambassador at FourthWorld.com                http://www.FourthWorld.com





More information about the use-livecode mailing list