Creating Hastags for Social Media with a Drafts Action

Creating meaningful, long #hastags can be a pain in the butt.

There you are, writing up a witty tweet or making that perfect caption for your instagram pic and you realize that you have a fantastic idea for a hash tag that is more of a sentence than a single word.

You proceed to write it out and unleash your masterpiece to the world and just as you hit the submit button you notice that you have a typo, or the wrong spelling of a word and #ohcrap you need to delete and retweet!

That lead me to write a Drafts Action to take care of that.

I’ll leave others to write about the virtues of Drafts, but it’s fantastic.

The Action I created has two steps: (1) to run some JavaScript and (2) to copy the contents of the draft to the Clipboard. You can get my action here.

Here’s the JavaScript that I used to take a big long sentence and turn it into a social media worthy hashtag

var contents = draft.content;
var newContents = "#";


editor.setText(newContents+contents.replace(/ /g, "").toLowerCase());

Super simple, but holy crap does it help!

One Reply to “Creating Hastags for Social Media with a Drafts Action”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.