Skip to content

Instantly share code, notes, and snippets.

View radetsky's full-sized avatar

Oleksii Radetskyi radetsky

  • Kyiv, Ukraine
View GitHub Profile
@radetsky
radetsky / imessage
Created September 22, 2017 10:10 — forked from aktau/imessage
Send iMessage from the commandline
#!/bin/sh
if [ "$#" -eq 1 ]; then stdinmsg=$(cat); fi
exec <"$0" || exit; read v; read v; read v; exec /usr/bin/osascript - "$@" "$stdinmsg"; exit
-- another way of waiting until an app is running
on waitUntilRunning(appname, delaytime)
repeat until my appIsRunning(appname)
tell application "Messages" to close window 1
delay delaytime
end repeat