OSACompileExecute grief
OSACompileExecute grief
- Subject: OSACompileExecute grief
- From: Mike Hore <email@hidden>
- Date: Sun, 17 Nov 2002 12:20:28 +0930
Hi folks,
I'm having colossal grief trying to send a simple script from one
app to another, in which I'm trying to compile and execute
the script.
I read the article in Develop of June 94, and my script compiles
fine, but I always get a runtime error when I run it. I have no
trouble from the Script Editor.
As it happens, I'm trying to send the script to Outlook Express,
but I get the same error with other applications so it's
definitely my problem, not OE's.
What I'm doing is setting up a string with the script,
then either calling OSACompile and OSAExecute, or OSACompileExecute.
To identify the runtime error I put in a try block and an "on error"
handler to pick up the error number, and it's always -903. That
means "no port" ???
Even if I just do
tell app "Outlook Express"
activate
end tell
I get this error. It only goes away if I put no content between
the tell and end tell, which isn't very useful.
I'm running OS 9.2.1, with the Applescript library (not Carbonized
yet). iMac with 160meg RAM.
Here's the code, which is simple enough. "string" is a C string
with the script.
--------
err = AECreateDesc ( typeChar,
script,
strlen(script),
&myDesc );
err = OSACompile ( gScriptingComponent,
&myDesc,
kOSAModeCompileIntoContext,
&compiledScriptID
);
err = OSAExecute ( gScriptingComponent,
compiledScriptID,
kOSANullScript,
kOSAModeAlwaysInteract,
&resultID
);
-------------
Anybody have any idea what's going on?
Thanks, Mike.
----------------------------------------------------------------
Mike Hore email@hidden
----------------------------------------------------------------
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.