a conundrum

John John at OneChip.com
Sun Oct 27 21:57:11 EDT 2013

   I am really hoping someone has run into this before and can point me in the right direction.  I have the following in a stack script:

on appleEvent pClass, pID
   local FilePath
   answer pClass && pID with "Ok"
   if pClass is "aevt" and pID is "odoc" then 
      request appleEvent data
      put it into FilePath
      answer filePath with "Ok"
   end if
   pass appleEvent
end appleEvent

    When I double click on a document created by the built app, the app launches but neither of the dialogs (from the “answer") appear.  If I drag and drop the document on the app icon the first time, no dialogs appear. If I do a drag and drop two or three times I then get the expected dialogs.  The first contains “aevt odoc” and the second gives me the path to the file.  I always get an “aevt quit” when I quit the app.

   I have an older version of the stack and it works fine (double clicking the document launches the app and reads the document via “finderReadNotes”).  The appleEvent handler is basically the same between them (there are no dialogs in the original) and I cannot for the life of me figure out what changed and why, after several drag and drops, I then get the dialogs.  Also, vary rarely, the app launches and reads the document when I double click on the document.

   This happens in both 6.1.2 and 6.5DP2.  Any thoughts would be appreciated.

Help please!,

More information about the Use-livecode mailing list