As much as we’d like it, typing isn’t dead. Voice recognition still has a long way to go. Either you’re like me and you write for a living, or you work in finance and most of your working hours are spent writing reports. It could be any number of things really.
But if you write a lot, you end up writing the same thing, over and over again. It could be as simple as your office address, your email or something more complicated like an email template, snippets of laws, anything really. And if you’re a pro user, you’d want to automate such a process. Thankfully, OS X has such a utility built right in. It’s called Text Replacement.
What Is Text Replacement? In general, the term is called text expansion.
But OS X being OS X, uses its own moniker. Actually, it doesn’t even do that. The feature in System Preferences is kind of nameless. It just exists under “Text” section. Text expansion (or text replacement, or text substitution) is a process of typing a shortcut or snippet which is automatically converted to a longer string of text by OS X. So let’s say I type in “@@“ and if I’ve set it up in a particular way, it will automatically change to “khamosh@iphonehacks.com” right after I hit that space bar.
You can do this for anything you want. Frequent typos you make, product names that are hard to remember and more. But how exactly? Let me show you. How to Set Up Text Replacement To get started, click the “Apple” icon from the menu bar and select “System Preferences”. Here, go to “Keyboard” and navigate to the “Text” section.
You’ll see a section on the left which has two parts – “Replace” and “With”. Click the “+” icon in the bottom right to add a new shortcut. Type the snippet (the shortcut) in the “Replace” section and what you want it to expand to in the “With” section. Do it for all the snippets you can think of. Open an app like TextEdit and try them out. Troubleshooting: Enable Text Replacement in Apps Some apps might not enable the Text Replacement feature by default.
If you come across an app that doesn’t support this feature, there’s a way to turn it on an app by app basis. Open the app in question and from the menubar, select “Edit” and go to “Substitutions” menu. From here, enable the “Text Replacement” option. If you don’t want to do this one by one and you’re familiar with using the Terminal, there’s a command you can use to enable Text Replacement for all apps. Open Terminal, paste the following command and press Enter.
Defaults write -g WebAutomaticTextReplacementEnabled -bool true One Problem: Doesn’t Work With Chrome The above command only works for apps that do support Text Replacement but have the featured turned off. If your browser of choice is Chrome, this might be a problem. Text Replacement feature is flat out disabled in Chrome. It works like a charm in Safari though. But if you can’t let go of Chrome, you might want to look into third party text expansion utilities. Speaking of which.
Alternatives and Going Pro I think using Text Replacement on OS X is a great starting point in your text expansion productivity journey. If you like the idea but you want a bit more features (and a lot more control), I suggest you look into. It’s currently and has pro features like macros, Apple Script support, clipboard entry and a lot more.
Lastly, Proper Text Expansion Etiquette If you’re new to the text expansion game, here are some helpful tips and tricks that will make you a pro in no time. Don’t use dictionary words as snippets. Keep the snippets short – 4 to 5 letters is the sweet spot. Just to reduce confusion and error, create a system where you use modifier keys before the shortcut. So let’s say, a shortcut begins with a comma.
For example: “,addrs”. Create snippets of both proper terminology and words you misspell often. For example: “gb” could turn in “GB”, “teh” could turn into “the” and so on. What are some of your favorite text expansion hacks?
Share with us in the comments below.
My personal experience follows matt's comment above: requires serious technical knowledge. There are several ways to do this, and one is typically as follows: extract some properties from the sound segment of interest (audio feature extraction), and classify this audio feature vector with some kind of machine learning technique. This typically requires some training phase where the machine learning technique was given some examples to learn what sounds you want to recognize (your predefined sounds) so that it can build a model from that data.
Without knowing what types of sounds you're aiming for to be recognized, maybe our C/C SDK available here might do the trick for you: There's a technical demo on that page that you can download and try with your sounds. It's a C/C library, and there is a Mac, Windows and iOS version, so you should be able to integrate it with a Swift app on iOS. Maybe this will allow you to do what you need? If you want to develop your own technology, you may want to start by finding and reading some scientific papers using the keywords 'sound classification', 'audio recognition', 'machine listening', 'audio feature classification'. Matt, We've been developing a bunch of cool tools to speed up iOS development, specially in Swift. One of these tools is what we called: a Swift wrapper around Pocketsphinx which can perform speech recognition without the audio leaving the device.
I assume TLSphinx can help you solve your problem since it is a totally open source library. Search for it on Github ('TLSphinx') and you can also download our iOS app ('Tryolabs Mobile Showcase') and try the module live to see how it works. Hope it is useful!