Skip to content

Instantly share code, notes, and snippets.

@JosiahParry
Created April 2, 2024 00:54
Show Gist options
  • Save JosiahParry/12ed1ea34a82dc10c4a7f37ba44e1317 to your computer and use it in GitHub Desktop.
Save JosiahParry/12ed1ea34a82dc10c4a7f37ba44e1317 to your computer and use it in GitHub Desktop.
Send a text using R from a Mac with iMessage
send_text <- function(message, buddy){
for(i in buddy){
system(paste('osascript -e \'tell application "Messages"\' -e \'send "', message, '" to buddy', i, 'of (service 1 whose service type is iMessage)\' -e \'end tell\''))
}
}
send_text(paste0(capture.output(iris), collapse = "\n"), r"{"phonenumberhere"}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment