Solved

Detect imessage user in AppleScript

Posted on 2015-01-06
1
710 Views
Last Modified: 2015-01-12
Hi,
I have written some AppleScript to automatically send messages via "messages" app in os x. It works fine. What I need to know is , is there a way I can detect of the number entered is a valid iMessage user via the script?
In the gui messages app the number goes blue if it is and red if it isn't.
Is there a handle of something I can use to detect this or can something be written in another language to detect this and send the messages?
Thanks
0
Comment
Question by:jellydeal
1 Comment
 
LVL 18

Accepted Solution

by:
Simon earned 500 total points
ID: 40534664
Hi, can you post your script?

I've done a lot of Applescript but never with the messages app.

I'd suggest opening the Applescript dictionary for the application (File/Open Dictionary, then browse to messages.app)

I'd guess that if you test the properties of 'Buddy' you'd be able to determine if it was valid or not:

buddy n, pl buddies [inh. item] : A buddy on a service.  syn account
elements
contained by application, services.
properties
id (text, r/o) : The buddy's service and handle. For example: AIM:JohnDoe007
service (service, r/o) : The service on which this buddy exists.
name (text, r/o) : The buddy's name as it appears in the buddy list.
handle (text, r/o) : The buddy's online account name.
status (available/‌away/‌offline/‌idle/‌unknown, r/o) : The buddy's current status.
status message (text, r/o) : The buddy's current status message.
idle time (integer, r/o) : The time in seconds the buddy has been idle.
capabilities (list of video chat/‌audio chat/‌multiperson video/‌multiperson audio, r/o) : The buddy's messaging capabilities.
image (TIFF picture, r/o) : The buddy's custom image.
first name (text, r/o) : The first name from this buddy's Contacts card, if available
last name (text, r/o) : The last name from this buddy's Contacts card, if available
full name (text, r/o) : The full name from this buddy's Contacts card, if available
responds to
invite.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you other experts are anything like me you are always looking into and testing out new features. While I was doing some research one day I ran across an app that I installed on my Mac and used as a security system. Mac OS X: SecureHome uses your …
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
The goal of the tutorial is to teach the user how to instant message and make a video call in Skype.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question