TootRain since 1.7.3 supports both AppleScript and Shortcuts.
You can find the availble commands from Script Editor. Here is an example of showing a status via AppleScript:
The body supports <img src=...>
tag, you can also specify the avatar URL like this:
https://is-he.re/emoji/lihkg/big-smile.gif\">world" avatar "https://is-he.re/emoji/lihkg/cow-ball.gif"
end tell
Since OS X 10.10, scripting is also available in JavaScript, so you can write code like this:
TootRain = https://is-he.re/emoji/lihkg/big-smile.gif"})
You can also access current visible statuses via the status
element.
This gives you an array of status, with the following properties
id
body
- The parsed body, HTML tags are stripped out.rawBody
- The raw text of the status, posts from Mastodon usually contains HTML like <p>hello</p>
username
screenName
While there’s no API to get a script triggered when there’s a new status, it’s always possible to poll the status
array. Here is an example of a script, automatically reading out the body whenever there’s a new status.
Shortcut integration is much simpler, the only command supported is to show status on screen. The text
option support <img src=...>
tags, and the avatar
option is optional.