If you use BBEdit to work with text files, you're certainly aware of its powerful regular expression feature for searching and replacing text. Based on the PCRE (Perl Compatible Regular Expressions) engine, the BBEdit regex language can find and replace pretty much anything.
GitHub user ccstone has published a BBEdit Regular Expression Cheat Sheet, which shows all the standard regex meta-characters, those used for non-visible characters (such as tabs and returns), and classes (such as digits, lower-case letters or alphanumeric characters).
If you use BBEdit to find and replace text, and especially if you're not familiar with using regular expressions, you should bookmark this page.
Over at the Mac Observer, Dave Hamilton told of an iPod touch whose SpringBoard would repeatedly crash. (SpringBoard is the iOS equivalent of the Finder.) After trying a number of troubleshooting procedures, he narrowed it down to an iCloud issue, where corrupt data was causing the crash. Hamilton found info in crash logs indications of what was causing the crash. He eventually deleted a folder on the Mac that was linked to the iPod (com~apple~TextInput) and this resolved the issue.
iCloud has been, for me, a common source of dismay. I've not found it to be reliable enough to entrust any important data to it - though for some data, such as contacts and calendars, you have no choice. I've had to go through complicated procedures to reset different types of iCloud data several times to resolve syncing issues. This crashing problem is just another of the issues that iCloud can be responsible for.
Apple has released Safari 6.0.4, and 5.1.9, which, together with a recent update to Java, provides site-specific settings for activating Java. As Java has become a widely-exploited vector for malware attacks, it's a good idea to keep it turned off if you don't need it. The problem is, however, that many people do need it, and the safest way to protect from drive-by attacks on malicious websites is to provide a site-specific activation method.
Safari 6.0.4 offers this. If you visit a website that tries to load a Java applet, a dialog will ask if you want to block or allow the applet. You can later go to Safari > Preferences > Security, and click on Manage Website Settings (just after the Allow Java option) to view a list of websites which have attempted to load Java applets. You can then change the behavior for each of those sites.
Amnesty, the reverse engineered version of Apple's Dashboard that allows widgets to run on the desktop with Konfabulator-like abilities, has been made open-source and is now freeware.
Originally released in 2005, days after Apple introduced Dashboard with its release of OS X Tiger, Amnesty was built around an engine allowing it run widgets independently of Dashboard, and thus could give additional capabilities to widgets including adjustable desktop level and opacity. The engine also allowed users of OS X Panther to run Dashboard widgets.
Amnesty was released to many positive reviews, including a sidebar mention in David Pogue's Missing Manual for Tiger, but as the interest in widgets waned in the past few years, its popularity and sales began to decline.
Developer Danny Espinoza, who had recently stopped releasing updates for his products sold under the name Mesa Dynamics, felt it was best to release all his software products, including Amnesty (and Amnesty Singles, a widget-to-application converter), as open source as part of their official discontinuation.
Amnesty 1.6 is free and requires Mac OS X 10.4 and later. The application and its source code are available at mesadynamics.com.
[crarko adds: Consider this a public service announcement and a thank you. I used this program back in the day and liked it a lot. I support the notion of developers taking discontinued software and making it open source instead of letting it collect dust (whenever it's practical to do so).]
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.