iPhone Notes Shell Script
From KevinWiki
(Difference between revisions)
Kevin (Talk | contribs)
(Created page with "Category:iPhone {{lowercase}} = iPhone Notes Shell Script = <source lang="bash"> #!/bin/bash FILE="/tmp/iphone-note-mail.tmp" id=`uuidgen` if [ -f "$1" ] then echo "File: ...")
Newer edit →
(Created page with "Category:iPhone {{lowercase}} = iPhone Notes Shell Script = <source lang="bash"> #!/bin/bash FILE="/tmp/iphone-note-mail.tmp" id=`uuidgen` if [ -f "$1" ] then echo "File: ...")
Newer edit →
Revision as of 19:53, 7 September 2012
iPhone Notes Shell Script
#!/bin/bash FILE="/tmp/iphone-note-mail.tmp" id=`uuidgen` if [ -f "$1" ] then echo "File: $1" echo "=================== Contents ===================" cat "$1" echo "=================== ENd ====================" echo "Would you like to send it? (y/n)" read SEND_IT if [[ "$SEND_IT" == "y" || "$SEND_IT" == "Y" ]] then SUBJECT=`head -n 1 "$1"` echo "From: your.username@your-email.com" > $FILE echo "To: your.username+note@your-email.com" >> $FILE echo "Subject: $SUBJECT" >> $FILE echo "X-Uniform-Type-Identifier: com.apple.mail-note" >> $FILE echo "X-Universally-Unique-Identifier: $id" >> $FILE echo "" >> $FILE cat "$1" >> $FILE echo "Sending new note...." sendmail "your.username+note@your-email.com" < $FILE rm $FILE echo Done. else echo "Sending note cancelled." fi echo "" exit fi echo "The file ($1) does not exist!" exit