Solved

Detect imessage user in AppleScript

Posted on 2015-01-06
1
606 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:
SimonAdept 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Article by: Ahmedn1
Introduction Some developers today tend to use Skypekit in their applications to make it more interactive with the user. Skype API is very awesome indeed but the problem is it is only available in C++, Java and Python. I can't understand why Micr…
CocoaPods is the best way to manage library dependencies in iOS and OS X projects. By using cocoa pods there is no need of downloading the code from github and copying to your project. There are plenty of open source libraries now available with C…
The goal of the tutorial is to teach the user how to instant message and make a video call in Skype.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now