Skip to content

Instantly share code, notes, and snippets.

@netstu
Created December 20, 2013 05:44
Show Gist options
  • Save netstu/8050872 to your computer and use it in GitHub Desktop.
Save netstu/8050872 to your computer and use it in GitHub Desktop.
applescript
set csvData to read "/Users/netstu/Downloads/mbis.csv"
set csvEntries to paragraphs of csvData
repeat with i from 1 to count csvEntries
set phone to (csvEntries's item i)'s text
tell application "System Events" to tell process "Messages"
set input to "how are you" as text
click button 1 of group 1 of splitter group 1 of window 1
delay 1
keystroke "" & phone & "" -- type the reciever
keystroke return -- validate the previous input
--keystroke tab -- move to message input
--keystroke input -- type the message
--keystroke return
--keystroke return
end tell
tell application "Messages"
--tell application "System Events" to tell process "Messages"
--set phone to (csvEntries's item i)'s text
set myid to get id of first service
set theBuddy to buddy phone of service id myid
--set theBuddy to buddy phone of service "AIM" --id myid
send "祝您在圣诞节来临之际,合家欢乐,万事如意" to theBuddy
end tell
end repeat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment