###How Do I Get Properties of Messages.app Chat?
Running Messages 9.2 (5100) on macOS 10.11.4
No matter what I try, the chat properties are always unavailable:
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
tell application "Messages"
set oChat to first text chat
set propList to properties of oChat
end tell
Thanks, but that’s really dumb, isn’t it?
If I, as the user, can open the Messages app and view all of the Chat info, why would there be a security risk for doing exactly the same using AppleScript?
Also dumb, is that I can setup an AppleScript to trap new incoming Chats, and get all the info I want. What makes one be a security risk but not the other???
I’m just speculating. There are plenty of things a user can do that are not allowed via AppleScript.
Not at all. If you get a response along the lines of “Works as expected”, you know it’s deliberate. And if it is a security issue, chances are that’s what will happen.
It is not a SD issue.
I’ve tried many different ways to trying to get the chat properties.
for example:
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
tell application "Messages"
set chatList to every text chat
end tell
This looks like a dead end. Although lots of information should be in the chat properties (according to the object model), the explorer shows nothing of any value.
Script Debugger’s explorer is doing this because when it tries to determine the type of object instance it is dealing with it is receiving an incorrect object type (cobj - item instead of the correct ictt - text chat) from Messages.
If you try and read a text chat property directly in AppleScript:
tell application "Messages"
active of text chat id "iMessage;-;+12509999999"
end tell
You get an error back: Messages got an error: Can’t get active of text chat id "iMessage;-;+12509999999". I can only conclude that this is a Messages bug. The only thing I can suggest is file a bug with Apple and hope that someone cares enough to resolve the problem.
You need to get yourself a free developer.apple.com account, and file a bug through Bug Reporter. Think of each bug report as a vote: the more there are the more likely someone is to notice the issue.