How programmer gets his wife happy (part 2: iMessage)

< 1 min read

Following my post about How programmer gets his wife happy, here is a simpler version for who is using Mac with Message app.

zen8labs programmer ii

Forget all Twilio setup, you just need to create the cronjob. Replace the content and your wife’s number.

1. Create a file sweet_sms_to_darling.sh, put the command above.

#!/bin/bash /usr/bin/osascript -e ‘tell application “Messages” send “I need to go home late. Love you.” to buddy “+84988999888” of (service 1 whose service type is iMessage) end tell’ echo “Let go buddy”

/usr/bin/osascript -e ‘tell application “Messages”

send “I need to go home late. Love you.” to buddy “+84988999888” of (service 1 whose service type is iMessage)

2. Get it executable, and run at 18:30 every day.

MacBook-Pro:twilio tom$ chmod 775 sweet_sms_to_darling.sh MacBook-Pro:twilio hien$ vi /etc/crontab

MacBook-Pro:twilio tom$ chmod 775 sweet_sms_to_darling.sh

MacBook-Pro:twilio tom$ vi /etc/crontab

Add this line, correct your file path, 18, 30 is the hour and minute triggers this bash script.

30 18 * * * ~/Desktop/sweet_sms_to_darling.sh

30 18 * * * ~/Desktop/sweet_sms_to_darling.sh

3. Save this file and add to cronjob. That’s all.

MacBook-Pro:twilio hien$ crontab /etc/crontab

MacBook-Pro:twilio hien$ crontab /etc/crontab

Life is easy if you are a programmer. Have a look at the fun they have here!

Related posts

Have you ever considered the importance of database connection pooling? Here we should you the information you need to know for a database connection pool.
3 min read
Storing data in the right location is a challenge that faces any company. Our new blog introduces you to AWS S3 storage system and how to make it work for you.
5 min read
Knowing the correct scan is important to accessing the right data and improving queries. In our latest blog we look at different scan types used in PostgreSQL and what they do
8 min read