?
Solved

Detect imessage user in AppleScript

Posted on 2015-01-06
1
Medium Priority
?
794 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 18

Accepted Solution

by:
Simon earned 2000 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Syslogd is a utility that traps and logs messages sent by running processes. It is configured with the syslog.conf file, which consists of lines containing a pair of fields: "the selector field which specifies the types of messages and priorities to…
Skype is a P2P (Peer to Peer) instant messaging and VOIP (Voice over IP) service – as well as a whole lot more.
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 …

752 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