Solved

Detect imessage user in AppleScript

Posted on 2015-01-06
1
731 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 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

The /etc/authorization file in Mac OS X 10.x can be used to control access to the various panes of the System Preferences amongst other things. It’s used by some of us Mac Sys Admin’s to give Standard Users access to System Prefs panes that only adm…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
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 …

738 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