I was annoyed by a behavior of Messages.app. When a friend sends me a message the chat window will not open automatically. Instead the Messages app icon will get a badge and bounce a couple of times in the dock.
But if I'm not currently at the computer, and since I do not use the Dock to launch apps and I have the Dock always hidden, I could easily miss a message for a long time. So I came up with the following solution.
First open /Utilities/AppleScript.app and paste the following into the script editor:
using terms from application "Messages"
on message received theText from theBuddy for theChat
set visible of window "Messages" to true
end message received
end using terms from
Pick a name and save the script in the scripts folder ~/Library/Scripts.
Next open up /Applications/Messages.app and do the following:
Under Preferences select Alerts.
Under Event select Received Message.
Tap Run an AppleScript and select your previously saved script under the Pop-Up menu.
Now when you receive a new message while you are away from the computer you have an open window with the message waiting for you.
[crarko adds: I haven't tested this one. You need to be running 10.8 or later to have the Messages application, of course.]
TextEdit has a dialog that lets you select lines. You can invoke the Select Line window by pressing Command-L. In this window, you can enter a single line number, but you can also enter relative selections or ranges. For example, enter the following:
2: selects line 2.
+2: selects the second line after the line where the cursor is.
-2: selects the second line before the line where the cursor is.
12-14: selects lines 12, 13 and 14.
+2-4: selects 3 lines, 2 lines after the line where the cursor is.
-2-4: selects 3 lines, 2 lines before the line where the cursor is
Mail lets you choose to show the number of unread messages in mailboxes, but there's no way to show the total number of messages in your mailboxes. While most people may not want this, you might want to know how many messages are in certain mailboxes.
There's an interesting solution to this problem over at Stack Exchange, where user jaume presents two AppleScripts to accomplish this. The idea is to use the AppleScript to count the number of messages in the mailbox, then change the name accordingly, to something like "Messages (23)." The two scripts either change the names of a number of specified mailboxes, or of mailboxes whose names begin with the @ character. The script can be set to run via a Mail rule, such as every time new messages are received.
This is a nifty solution to a problem that many people wouldn't think of, but that can be useful in certain situations.
I use Dropbox to sync a backup of a number of local folders, and run a backup script every evening. When I got up the other morning, Dropbox was still running hard, and my Mac mini's fan was spinning. I clicked on the Dropbox menu item, and then on the gear button (this is with Dropbox 2), and saw that some files couldn't be copied because of "permissions denied" errors.
It turns out that Dropbox has a hidden feature to fix such things. Open the Dropbox preferences, click on Account, then press the Option key. The Unlink This Computer button will change to Fix Permissions. Click that button and let Dropbox go through your files.
Today, I went to send a weekly email to a list I maintain in Contacts, and I noticed that my group had inexplicably lost 7 cards! So I restored the contact cards from Time machine, which allowed me to only "Keep New" ones. However, I ended up with more cards than I knew I was supposed to have.
So I tried using Contacts' "Look for Duplicates" feature, but it would not let me review the duplicates. It simply told me that I had 28 duplicate cards and 8 duplicate entries based on people having the same name, and offered to let me either select Merge or Cancel. I'd sorted out messy merges before, so I wasn't about to get into that morass. So I devised my own way of finding and reviewing duplicates.
First, I selected my group, clicked the name at the top, then Shift-clicked the last name to highlight all the cards. I then dragged them into the to field of an empty email. I then typed Command-A to select them again and pasted them into a temporary TextEdit plain text document which I named "dupe_search.txt". (If anyone knows a way to skip the email/drag step, let me know.) I then ran the text document through this set of piped commands in Terminal:
This returns a list of email addresses with the number of times they occur in Contacts to the left. I then manually searched for each one in Contacts to inspect the dupes.
To merge the cards, select them and just type Command-Shift-| or select "Merge Selected Cards" from the Card menu.
I remembered after doing this that most of my missing cards had been a series of duplicates I'd previously merged a week ago! But I did recover 4 that had apparently slipped through Apple's cracks.
Be wary about maintaining lists in Contacts, especially if you use iCloud. I have found some disturbing bugs, such as when you right-click on a group and select "Send email to '...'", I wasn't getting the same number of email addresses as when I manually selected all the cards in that group and dragged them to the email! I've been adding emails via my iPhone - and I'm not sure I trust that iCloud is syncing them correctly given these four recovered cards!
[kirkmc adds: I haven't tested this. I have often had problems with Contacts, however, especially with certain cards having multiple email addresses that come from other cards. I wish there were a better way to clean out the Contacts database.]
A recent article in TechHive points out that you can now use line breaks in tweets. However, this is nothing new; I've been doing this for a long time, with my Twitter clients. Just press Option-Return to make a line break that does not act as press Return (or sending a tweet). It's worth noting that Option-Return works in just about any text field, including those where Return sends text (such as in Messages). This isn't a new hint; this feature has been around for ages, but it's good to know.
It's worth noting that my Twitter client of choice, Twitterrific, already handles Returns as line breaks; you have to press Command-Return to send a tweet.
You may have seen the news that Google Reader is shutting down as of July 1, 2013. If you use Google Reader, you may want to save your feeds to be able to import them into another RSS reader.
Go to Google Reader, then click on the gear icon at the right of the page and choose Settings. Click in Import/Export. In the Export your information section, click on Download your data through Takeout. Follow the instructions to download your data.
When you download the data, you'll get a ZIP archive. Double-click it, and look in the Reader folder for a subscriptions.xml file. You can use that to import your feeds into other RSS readers.
If you ever accidentally delete a contact, you can go to the Dropbox website and find older versions of your Contacts database.
[kirkmc adds: Obviously, this hint is useful only for those who don't use Time Machine. But it also suggests a way to store backups of other key files.
In the AddressBook folder, you'll find the entire Contacts database (AddressBook-v22.abcddb), which you can restore, but, while it may include contacts you've deleted, it might not have new contacts you've added. There's also a Metadata folder, which contains cards for your contacts, which are used when you search with Spotlight. You can browse through these cards and, if you find a contact you've lost, double-click it to add it to Contacts.]
Let's face it: ringtones are boring. And annoying. How many times do you want to hear the refrain from your favorite song when someone calls? And do you realize how annoying it is to others to hear a blasting bit of the latest Lady Gaga song.
On the other hand, using a default iPhone ringtone means that, if you're in a crowded area, lots of people will check their phones, thinking that they're getting a call, since they use the same ringtone.
You may be familiar with App.net, a service designed to be an alternative to Twitter. Originally a subscription-only service, App.net now has free tiers on an invitation-only basis.
App.net has an open API which allows developers to do interesting things. One of these is Project Amy, by Steve Streza which allows you to use Messages in OS X to send and receive App.net private messages. If you use App.net, you can download Project Amy here.