Mac uses imessage to send messages automatically

Source: Internet
Author: User

Build a CSV file with Excel, the first field is a number, the second field is the content

CSV file contents

189*****773;hello1

189*****773; Hello2

189*****773; Hello3

189*****773; Hello4

Open the Script Editor

Tell Application "Messages"

Set the This_folder to Path to Desktop folderasalias

Set Thefullpath to POSIX Path of This_folder

Set CSVData to Read thefullpath & "/test.csv"

Set csventries to paragraphs of CSVData

Set Targetservice to ID of 1St Service whose Service Type = IMessage

repeat with I From 1 to Count csventries

Set Potion To (offset of ";" inch (csventries ' sitem i) ' s text )

set phone to text 1 thru ( potion -1) of ( Csventries ' s item i ) ' s text

set MessageBody to text ( potion + 1) thru -1 of ( csventries ' s item i ) ' s text

Set Thebuddy to Buddy phone of service ID Targetservice

Send messagebody to Thebuddy

End Repeat

End Tell

The code is simple, there's nothing to talk about, the test passes


Mac uses imessage to send messages automatically

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.