Created
April 2, 2024 00:54
-
-
Save JosiahParry/12ed1ea34a82dc10c4a7f37ba44e1317 to your computer and use it in GitHub Desktop.
Send a text using R from a Mac with iMessage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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