Last active
August 6, 2016 16:42
-
-
Save bgmort/0fcf5971fe80e2c8ac13737caf9aa9b2 to your computer and use it in GitHub Desktop.
Simple way to send a whole bunch of texts one at a time from MightyText
This file contains hidden or 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
Drag this link to your bookmark bar to save as a bookmarklet: | |
<a href="javascript:var s=document.createElement('script');s.type='text/javascript';document.body.appendChild(s);s.src='https://rawgit.com/bgmort/0fcf5971fe80e2c8ac13737caf9aa9b2/raw/mightytext-masstext.js'; void 0">Mighty Mass Text</a> |
This file contains hidden or 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
/** | |
* Simple way to send a whole bunch of texts one at a time from MightyText | |
*/ | |
var row = 0; | |
var messages = []; | |
function promptForMessages() { | |
messages = prompt(`Paste your messages here in the following format, tab-separated (You can paste from a spreadsheet or text editor): | |
Phone# Message | |
Phone# Message | |
... | |
You can paste multiple lines even though you can only see one line at a time in the box.`) | |
.split('\n') | |
.map(line => line.split('\t')); | |
row = 0; | |
if (messages.length) fillNextRow(); | |
} | |
//wait until the last message has been sent | |
function fillNextRow() { | |
if (!messages[row]) return alert("That's all of them. You're done!"); | |
$('#newSms').click(); | |
$('#selectContactForSingleCompose').val(messages[row][0]); | |
$("#send-one-text").focus(); | |
$("#send-one-text").text(messages[row][1]); | |
++row; | |
} | |
//visually verify then send | |
function send() { | |
$('#send-button-single-text').click(); | |
} | |
var right = 200; | |
function makeButton(text, fn) { | |
$('<button>') | |
.text(text) | |
.appendTo('html') | |
.css({ | |
background: '#e74c3c', | |
color: 'white', | |
fontFamily: "'Helvetica Neue', Arial, sans-serif", | |
borderRadius: 4, | |
border: '1px solid #b95555', | |
fontSize: 11, | |
textTransform: 'uppercase', | |
position: 'fixed', | |
top: 5, | |
right: right, | |
width: 95, | |
height: 50, | |
zIndex: 9, | |
}) | |
.click(fn); | |
right += 100; | |
} | |
makeButton('Send', send); | |
makeButton('Next Message', fillNextRow); | |
makeButton('Paste Messages', promptForMessages); | |
promptForMessages(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment