Poor Man’s Text Expander

I use Tactor’s (http://onflapp.wordpress.com/tactor/) regexp functionality to expand my custom text macros. For for example, I can define something simple like MYEMAIL => tom@foobar.com. However regexp allows me to do more interesting things as well, like creating links: wiki:MyDocumentation => http://pages.intranet.com/docstore?page=MyDocumetation?view=html.
– lauch Tactor (it is free app)
– go to preferences -> regexp
– add regexp
you can use capture groups here, e.g. wiki:(w+)
– set the ‘matched key’ to ACT_TEXT – this will place the result into the clipboard
– set the ‘matched key’ to what the resulting text should be like
you can use the regexp substitution here, e.g. http://foobae/$1
– expanding is done by selecting the text macro in a text (any text field should work) and choosing ‘Expand Selected Text’ from the top bar menu.
This method is kind of technical to setup but very powerful. If one is not afraid of a bit of programming, it is possible to …

Source: Mac OSX Hints

    

Avoid a cluttered download folder by using /tmp

First thing I do when I get a new system is to redirect downloads from ~/Downloads to /tmp.

The advantage with this adjustment is that in /tmp files older than a week is automatically deleted (and at every restart). Almost all files I download don’t need to be stored, for example:

1. Installers. Run the installer (or dmg) from /tmp and then forget about it and it is automatically deleted within a couple of days.

2. PDFs I just want to read (or possibly print) once.

3. Templates, e.g. expense reports and similar (typically .doc or .xls). I download it, fill it in, generate a pdf and e-mail to the appropriate recipient. No need to keep the original template.

4. Torrents. Download the torrent, add it to your torrent client and then there is no need to keep the original torrent file around anymore. Besides, a lot of the files I download using torrents I just “use” them once so they can be also be downloaded to the same folder as the torrent is stored in, that i …

Source: Mac OSX Hints

  

Applescript to work around a Finder bug in Mavericks

Mavericks introduced several bugs into the Finder. One of them is that in List View, the Finder frequently loses track of the column widths, and makes the Name column so wide that the other columns aren’t visible unless one scrolls the window horizontally.

The following Applescript resets the column widths to something sensible. It uses a couple kludges to work around some *other* Finder bugs that Mavericks introduced.

— Reset the width of the Finder’s Name column to something sensible.
tell application “Finder”
set thisFolder to target of front Finder window
set the current view of front Finder window to list view
— In previous versions of OS X, the next line would tell the Finder to set the width
— to exactly 300. In Mavericks, the Finder uses it as a *minimum* width.
set width of column id name column of list view options of Finder window 1 to 300
— The following kludge is necessary to get the changes to “take”. I got it from
— Dr. Drang at www.leanc …

Source: Mac OSX Hints

  

Import lists into Reminders app on Mac from a plain text file.

I wanted to import lists into the Reminders app on the iMac. (iCloud syncs the lists to other devices … when sync is functioning correctly.) The Reminders app’s import function acts only on .ics files. Went seeking solutions for plain text files.

Found Ben’s Applescript at http://benguild.com/2012/04/11/how-to-import-tasks-to-do-items-into-ios-reminders/.

It provides a nice technique to import a list from a plain text file into the Reminders app on Mac OS X.

Source: Mac OSX Hints

  

Bash Function to open man pages in new terminal window

When I’m stumbling around the command line, I usually need to keep various man pages open for reference. I always forget I can get a dedicated man window from the Help or Contextual menus. This bash function allows you to open a man page in a new window directly from the command line.

function man { if [ $# -eq 1 ] ; then open x-man-page://$1 ; elif [ $# -eq 2 ] ; then open x-man-page://$1/$2 ; fi }

Just put this function in your .bashrc file, and when you use the man command, the information opens in Terminal’s Man Page specific window setting style. If you don’t want to override the default ‘man’ command operation, you can change the function name to something else.

This function expands on OS X’s x-man-page url scheme. And of course, there are plenty of alternate ways to view man pages such as …

Source: Mac OSX Hints

  

Easily rearrange mail accounts in Mavericks Mail.app

While you can easily rearrange the order of your accounts in Mavericks’ mail sidebar, when composing a message there is no easy way of rearranging the accounts as shown in the “From:” dropdown box in a new message; accounts are listed in the order in which they were added, which, in the case of using iCloud Keychain, may be vastly different than the order that you want them in.

Fortunately, there is an easy procedure to rearrange them:

Open up the “Internet Accounts” system preference pane
For each email account, in the order you want them to appear, uncheck and then re-check “Mail”

In this way, the accounts will be removed and readded to Mail in the order that you want them to appear.

Source: Mac OSX Hints

  

Touch camera icon in lock screen to turn off flashlight

In iOS 7, suppose you trigger the flashlight via Notification Center.

After using the flashlight, you don’t have to swipe up the Control Center and tap the flashlight icon again to turn it off—no, no. There’s a simpler way.

Trigger the lock screen, and then simply touch the camera icon in the bottom right corner: The flashlight goes off.

Source: Mac OSX Hints

  

Update bluetooth service in Mavericks

I recently started having severely shortened battery life on my Magic Trackpad. It turns out the fix is pretty easy.

When researching the problem, I found the standard fix reported over the last few years was to “update service” in OS X’s bluetooth preferences. Looking for that option in Mavericks proved fruitless. Finally, out of desperation, I selected the option to disconnect the trackpad, then re-associated it. Immediately, the day-old batteries showed a 100% charge instead of the prior 10% and I’ve had no problems since.

Source: Mac OSX Hints

  

Go to a specific line in TextEdit

Light-duty coders may be a bit frustrated when a browser or compiler chucks an error that cites a line number. Yes, you can get lovely third-party editors that make it much easier to work with such things, but what if you’re keen on simple TextEdit?

Hit Command+L to open a “Select Line” dialog. (It also lives, oddly, under the “Find” sub-menu.)

Type in a line number and you’re off to the races!

Source: Mac OSX Hints

  

Just another Mac Tips site