Solved

Detect imessage user in AppleScript

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to Copy Music from Old Mac to new Mac 5 91
Office365 / office 2016  for MAC 4 49
Using iCloud Drive with iCloud 2 28
Migrate Application To New Mac 5 32
Months ago my boss came to me with a simple request, “How can we minimize GoTo meeting accounts and also improve our integration and collaboration initiatives?”  Well the answer, with some research, was easy… Lync.  Lync provided us all the necessar…
In this article we have discussed about the OS X EI Capitan and how to fix Wi-Fi issue in OS X El Capitan. We have explained how to delete system level preferences and create a new Wi-Fi location to resolve Wi-Fi issue.
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 …

896 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

19 Experts available now in Live!

Get 1:1 Help Now