Indigo Server restart -> iMessage, AppleScript to Python

Posted on
Wed Apr 11, 2018 2:01 am
McJohn offline
User avatar
Posts: 631
Joined: Dec 18, 2012
Location: The Netherlands

Indigo Server restart -> iMessage, AppleScript to Python

Is it possible to convert this AppleScript to something in Python?:

(we use a Trigger when "Indigo Server Startup" an iMesssage warning will be received)

Code: Select all
tell application "Messages"
   set theBuddy to buddy "me@mac.com" of service "E:indigoserver@somewhere.com"
   send "HomeServer restarted " & (time string of (current date)) to theBuddy
end tell


Thanks for the help.

Posted on
Wed Apr 11, 2018 9:58 am
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Indigo Server restart -> iMessage, AppleScript to Python

First, there really isn't a need to convert it since it doesn't target the IndigoServer.

However, if you want to run it from a Indigo Python script:

Code: Select all
import applescript
script_source = '''tell application "Messages"
   set theBuddy to buddy "me@mac.com" of service "E:indigoserver@somewhere.com"
   send "HomeServer restarted " & (time string of (current date)) to theBuddy
end tell'''
script = applescript.AppleScript(source=script_source)
script.run()


Or, use one of the plugins that does push notifications (Prowl, Pushover, Pushsafer, etc.)...

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Apr 11, 2018 11:09 am
McJohn offline
User avatar
Posts: 631
Joined: Dec 18, 2012
Location: The Netherlands

Re: Indigo Server restart -> iMessage, AppleScript to Python

Thanks for the help Jay, I appreciate that.
This script works perfect and now we don't need another extra plugin for a simple solution :wink:

Posted on
Wed Apr 11, 2018 12:08 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Indigo Server restart -> iMessage, AppleScript to Python

The complexity of maintaining a script vs using a plugin with a nice UI would seem a simple tradeoff. But that's just me... ;)

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Apr 12, 2018 12:13 am
McJohn offline
User avatar
Posts: 631
Joined: Dec 18, 2012
Location: The Netherlands

Re: Indigo Server restart -> iMessage, AppleScript to Python

And a Plugin don't need maintenance? :wink:

Posted on
Thu Apr 12, 2018 9:27 am
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Indigo Server restart -> iMessage, AppleScript to Python

McJohn wrote:
And a Plugin don't need maintenance? :wink:


Likely, someone else will do the maintenance, particularly if it's a popular plugin. And all you have to do is update it (if it stops working). You'll also benefit from any enhancements that may be added to the plugin. Again, all you have to do is update it and tweak the UI. :lol:

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Apr 13, 2018 1:17 am
McJohn offline
User avatar
Posts: 631
Joined: Dec 18, 2012
Location: The Netherlands

Re: Indigo Server restart -> iMessage, AppleScript to Python

You are absolutely right Jay and I understand what you mean.

Maybe in a future version of Indigo there could be an option within the Indigo Preferences menu:
- email address and iMessage address of the user.
(so with a Trigger Notification action not every time the Users email address has to be filled in (or in this case the iMessage address).

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest