Hi all, here’s what I want to do:
- 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 "E:mail@sjungarna.se"
end tell
It works just fine by itself.
- 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:
-
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. -
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.