All posts by mactips

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

  

Change a static event to recurring

I don’t know whether this is a common issue. From time to time, I find myself changing an event in my calendar (which may have originally been recurring) that is static and that I now want to become recurring. At least sometimes, Calendar will not let me change the event from static to recurring.

This problem forces me to manually copy all relevant information into a new recurring event. I find it frustrating.This may be because this is achieved transparently in Outlook at work.

Anyway, I found somewhat of a compromise. Duplicate the event (many ways including right-click on it then select Duplicate). Open the duplicate event, and set it to the desired recurring period. Of course, don’t forget to discard the original static event.

For some reason, whereas the original static event could not be made to recur, the duplicate static event can be.

This is not elegant by any standard even the lowest but is simple enough.

Source: Mac OSX Hints

  

Mount a SanDisk Connect Wireless Flash Drive

The SanDisk Connect Wireless Flash Drive includes all the benefits of a regular flash drive plus wireless mobile access.

Sandisk gives you an app that allows you to connect to the Flash Drive’s WiFi and transfer files. You can either connect via USB on the Mac or connect using a WiFi network. But what was not very clear was how to do this if you wanted to connect to the drive and upload or download files to and from your Mac wirelessly.

I tried to do this once I had connected to the drive’s WiFi network and using a browser (as they suggest) to connect to the given URL. The address is served from the Flash Drive’s WiFi network and in turn shows you the files on the drive. But I could not see my files and realised the page was being directed via my Ethernet connection across the Internet to a SandDisk page telling me the drive was not connected.

Turning off the Ethernet connection fixed th …

Source: Mac OSX Hints