Problem: 1657921
Title: (AppleScript) MacApp doesn't AEOpen Event
Received: May 22 1997 4:37PM
Here's my simple test scenario:
1. Build DemoText68K_d 2. launch DemoText, create a file, save it as "try me" 3. create a simple script using the Script Editor: tell application "DemoText68K_d" open "try me" end tell 4. make certain the script and the "try me" are in the same folder as the DemoText app 5. run the script and watch the DemoText app not handle it; instead it reports the -1700 error.Question: how do I get this to work? I build the MacApp libs and headers with qAttach and all the other stuff.
By placing a breakpoint at UFailure::Failure(), we find the following when attempting to send an 'odoc' event to DemoText to open a file that was created by DemoText (remember, this call-chain is in reverse order):
TOSADispatcher::DispatchHandlerGlue() TOSADispatcher::DispatchHandler() MScriptableObject::HandleScriptCommand() TApplication::DoScriptCommand() TODocCommand::IODocCommand() TFilesCommand::IFilesCommand() TFilesCommand::GetFilesList() TAppleEvent::ReadHandleList() FailOSErr(-1700) Failure()All the appropriate SIZE flags are set on the app, as the example is right out of the box.
The bug only shows up if the AppleScript says open file "try me" A workaround is to use the alias form of the Open command in the script: open alias "try me"