Jump to content
Sign in to follow this  
JeffreyE

Send Do Script Apple event fro REALBasic app

Recommended Posts

Does anyone know the proper syntax to send the Do Script Apple Event from a REALBasic app? I've gone into the reference for Filemaker and Apple Events, but all the examples are for AppleScript and Frontier. I believe the following is the start:

dim ae as appleevent

ae = newappleEvent("misc", "dosc", "FMP5")

But I can't figure out the syntax for the next statement which is to send the event. I think it's something like...

ae.Send....

But after that...?

Thanks!

Best Regards,

Jeffrey Ellis

Share this post


Link to post
Share on other sites

You can use Applescript in REALBasic a lot easier than Apple Events. The following Applescript example will run the FileMaker script "MyCoolScript" in the database "MyDatabase."

code:

on run

tell application "FileMaker Pro"

activate

if not (exists (window "MyDatabase")) then

set myFile to choose file with prompt "Select the file 'MyDatabase'

Share this post


Link to post
Share on other sites

Thanks, Bob!

For the benefit of those interested in this subject, I also wanted to post this reply from Paul Scandariato Intelli Innovations, Inc.:

dim event as appleevent

event = newappleEvent("misc","dosc","FMP5")

event.stringParam("----") = "My Wonderful Script"

if not event.send then

msgBox "Darn!"

end if

However, in order to specify the proper file, you will either need to set up a object specifier, or send FMP a command to open a specific file - if it's already open, then FMP would just

bring it to the front.

Best Regards,

Jeffrey Ellis

Share this post


Link to post
Share on other sites

I just got into RealBasic to do programming on my

Mac. Can you Guys/Gals suggest a forum

for RealBasic. I've been looking and haven't had

any luck. It would be greatly appreciated

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.