Jump to content
Server Maintenance This Week. ×

AppleScript, FileMaker and iMessage


This topic is 4056 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Hi all, here's what I want to do:

1. Executing an AppleScript from FileMaker that will send an iMessage through OSX's Messages: 

I'm using this simple AppleScript from FileMaker:

:

tell
 application 
"Messages"

   send 
"tobias testar"
 
to
 buddy 
"+46709123456"
 
of
 service 

end
 
tell

It works just fine by itself.

2. Then have Messages.app to report back to FileMaker if the message was sucessfully sent (sometimes I don't know if a certain cell phone number is registered with iMessages or not). This reporting back to FileMaker from Messages is done with setting up Messages to perform an AppleScript at Message Sent (Messages Preferences > Alerts).

The AppleScript performed by Messages at "Message Sent" is this:

:

using
 
terms
 
from
 application 
"Messages"

   

   
on
 message sent

       
tell
 application 
"FileMaker Pro Advanced"

           
tell
 database 
"sjungarna"

               do 
script
 
"TEST-script som startas från AppleScript"

           
end
 
tell

       
end
 
tell

   
end
 message sent

   

end
 
using
 
terms
 
from

---

When disabling the AppleScript performed by Messages there's no error. But when using it, the following things happens:

1. FileMaker hangs and I have to press Escape, then a dialog with this text shows up in FileMaker: 

"Messages got an error: User canceled out of wait loop for reply or receipt." 

Then this dialog: 

"Unknown Error: -1711." The FileMaker script that should be executed (by the AppleScript from Messages) is NOT executed.

2. Messages.app shows this dialog: 

"An error occurred while executing an AppleScript event handler. Event: Message Sent - File: on message sent.scpt - Error: FileMaker Pro Advanced got an error: AppleEvent timed out."

Anyone knows how to solve this?

When I run the first AppleScript above from Finder instead of from FileMaker everything works just like it should including the FileMaker script that is triggered from the AppleScript from Messages.

Link to comment
Share on other sites

  • 3 weeks later...

This topic is 4056 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

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