Temporary text expanding snippets

I actually got this idea from David Sparks in one of the Mac power users podcast episodes. Because I’ve been catching up with past episodes, while also listening to new ones I haven’t been able to remember in which episode exactly he mentioned this, but it’s been one hell of a tip.

On any given project, sometimes you might find yourself having to write the same line over and over again, which is what text expanding apps applications are for. For example, expanding your email signature. In my case wbr expands to

With best regards,

The thing is, you might not consider adding a snippet to your library if it’s something you don’t plan on using again in the future. Well, I’d have to say I once believed this before I tried temporary text snippets, and it’s awesome. The other day I was working in Matlab, and I had to save a several figures and plots. If it’s something like processing processing over 20 or 50 images, I’d surely write a small script for saving the images and auto naming the files. But if its something like 10 or 15 images, it’s quite cumbersome to type this at the command line every time, let alone do it with the mouse. A typical line would be something like the following:

imwrite(imresize(psf_01,[320 320],'nearest'),'set01-psf-01.png','png')

Yes, something as regular as this expression is scriptable, but I’m only going to need this exact line some 10 or 20 times in on particular day. It’s not worth the effort.

On the other hand, making it a text snippet only takes me a minute, and I can continue to work with something less to worry about. As a text expanding application I use Typinator, which is really fast. I have a temporary snippets folder. For this snipper, I would put the abbreviation ,,psf to expand to the following

imwrite(imresize(psf_{{var=?psf number}},[320 320],'nearest'),'set01-psf-{{var}}.png','png')

The part in curly braces is a variable input. Therefore, when I type ,,psf in the Matlab command line, the following pop-up menu appears

Typinator variable

I fill in the appropriate number, and boom the following line of text appears

imwrite(imresize(psf_01,[320 320],'nearest'),'set01-psf-01.png','png')  

I don’t know you but I just find it so cool and powerful.


If you liked this post please leave a comment or consider subscribing.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s