Is it possible to sign in Message app from terminal ? When I search for it, I only see on how to send imessage from terminal. Thus, how can I do that ?
1 Answer
Messages supports AppleScript. You can view the Messages's AppleScript dictionary using the AppleScript Editor:
Applications > Utilities > AppleScript Editor.app
The AppleScript command log in
suggests you can sign in programmatically:
log in v : Log in to the specified service, or all services if none is specified. If the account password is not in the keychain the user will be prompted to enter one.
An example AppleScript to log in would be:
tell application "Messages"
-- Log into every session
log in
end tell
You can then use the osascript command line tool to issue AppleScript commands via the Terminal:
An example osascript
command to log in would be:
osascript -e 'tell application "Messages" to log in'
-
Than you, Graham Miln. I will try it. I will confirm if it works soon. Commented Oct 9, 2014 at 8:34
-
-
I can start with : using terms from application "Messages" on login finished with eventDescription end login finished Commented Oct 9, 2014 at 9:06
-
I have added examples for AppleScript and
osascript
approaches. Commented Oct 9, 2014 at 10:23 -
Thank again, Graham Miln. And can you tell me how I can put my apple ID and password to know it works well or not ? Commented Oct 9, 2014 at 10:30