Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Tidy up launchpad in Mountain Lion System 10.8
Mountain Lion's Launchpad is pretty good but it's still hard to get something out of it after you put it in if you didn't get it at the Mac App Store. If Launchpad Control is overkill for you, this might help.

Drop one or more application icons onto an AppleScript droplet created from the script below to have those items' Launchpad entries eliminated. You can drag items or be prompted to select them when the AppleScript runs if you don't want to save it as an application. There is some error checking and information in the script. It doesn't do anything to the apps themselves.

You can test it on the app itself. In AppleScript Editor, save it as an app, drag the app's icon onto Launchpad, activate Launchpad, launch the app, then drag the app's icon into the window and press return when prompted.

on open the_items
	my Lighten_LaunchPad(the_items)
end open

on Lighten_LaunchPad(the_items)
	repeat with the_item in the_items
		set the_item to the_item as alias
		--try
		tell application "Finder"
			set nameString to name of the_item
			set sost to (my get_the_name(nameString)) as string
		end tell
		display dialog "Are you sure you want to remove \"" & sost & "\" from the Launchpad? The app itself won't be deleted."
		try
			set my_command to "sqlite3 ~/Library/Application\\ Support/Dock/" & "*.db \"DELETE from apps WHERE title=" & (quoted form of sost) & ";\";osascript -e 'tell application \"Dock\" to quit'"
			do shell script my_command
		on error the error_message number the error_number
			activate
			if the error_number is not -128 then
				if the error_number is 1 then
					set the error_text to "Error: " & the error_number & ". " & "You probably have too many old versions of the LaunchPad database file." & return & return & " To fix that, move some old ones out of ~/Library/Application Support/Dock. You can safely move any file with a name that ends with \".db\" or \".db.backup\" except for the most recently modified one." & return & return & "Do you want me to open that folder for you?"
					display dialog the error_text buttons {"Yes, please open it.", "Cancel"} default button 1
					if button returned of the result is "Yes, please open it." then
						do shell script "open" & space & quoted form of POSIX path of (path to application support folder from user domain) & "Dock"
					end if
					error number -128
				else
					set the error_text to "Error: " & the error_number & ". " & the error_message
					display dialog the error_text buttons {"Cancel"} default button 1
				end if
			else
				error number -128
			end if
		end try
	end repeat
	display dialog "All done!" buttons {"OK"} default button 1
end Lighten_LaunchPad

on get_the_name(nameString)
	tell AppleScript
		set olD to text item delimiters
		set text item delimiters to "."
		set reqItem to -1
		if last item of nameString = "." then set reqItem to -2
		set theName to text item reqItem of nameString
		--try
		set theNameNoExt to ((text items 1 through (reqItem - 1) of nameString) as string)
		set text item delimiters to olD
		return {theNameNoExt}
	end tell
end get_the_name

on run
	set the_items to ((choose file) as list)
	Lighten_LaunchPad(the_items)
end run

  Post a comment  •  Comments (3)  
  • Currently 2.56 / 5
  You rated: 1 / 5 (9 votes cast)
 
[7,178 views]  View Printable Version
"Airplane mode" for OS X Network
A reader at Stack Exchange asked an interesting question about whether it was possible to set up an "airplane mode" for OS X. The idea was to ensure that there is no network activity through any possible network interfaces.

It's actually pretty simple to do this. If you go to the Network pane of System Preferences, you'll see a Location popup menu at the top of the window. Click on that menu and choose Edit Locations. Click on the + icon to add a new location, then enter a name, such as AirplaneMode. Click on Done.

Next, choose that location in the Location menu, and click on each available network interface in the list at the left of the window. Click on the Configure iPv4 menu, and choose Off. For Wi-Fi, just click on the Turn Wi-Fi Off button. Click Apply, and this location will block all network activity.

To activate the location, there are two ways. You can click on the Apple menu, then Location, and choose the location. Or, if you wish to do this from the command line, as the poster had requested, you can run this command:

networksetup -switchtolocation AirplaneMode

Replace AirplaneMode with the name you've chosen for the location.

Using airplane mode can be useful if you're worried about security when using a laptop in public places. It can also save battery power, as Wi-Fi will go off, and your Mac will no longer search for networks.
  Post a comment  •  Comments (17)  
  • Currently 2.91 / 5
  You rated: 2 / 5 (11 votes cast)
 
[12,839 views]  View Printable Version
Show the total number of messages in Mail mailboxes Apps
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.
  Post a comment  •  Comments (11)  
  • Currently 2.14 / 5
  You rated: 1 / 5 (7 votes cast)
 
[12,091 views]  View Printable Version
iOS text to speech from iBooks iOS devices
Our sister publication, Macworld UK, published a neat hint on recently, showing how to have an iOS device read texts from iBooks. iOS has accessibility features that can perform text to speech, but you need to know the trick to get this to work in iBooks.

First, turn on text to speech: go to Settings > General > Accessibility, and set Speak Selection to On.

Next, in a book, switch to scroll mode (tap the aA icon, then tap Themes to get to this theme), you can select a word and drag the selection far ahead in the book. Then, in the menu that displays, tap on Speak.

You can use this technique to have text spoken in any document, and there is a limitation in iBooks, where you can't select all the text and have it spoken. Since selecting is annoying - having to drag the handle a very long way - you may find this troublesome, but if you really want to have a text spoken, this lets you do so, even in iBooks, which is read-only.
  Post a comment  •  Comments (2)  
  • Currently 3.29 / 5
  You rated: 1 / 5 (7 votes cast)
 
[16,861 views]  View Printable Version
Create split zip files from the command line System 10.8

It appears that OSX 10.8 removed the tar --tape-length flag, and I see no other way to create split tar archives as described in this hint.

One alternative is to create split zip files using the zip tool provided with OS X.

As described in man zip, the resulting files are not just one big zip file that has been split into pieces, and thus they cannot gracefully be concatenated back together as described in another hint, so this differs from simply using the split command. I needed to send files to a Windows user with 7zip, so split was probably out of the question.

To get 4699717632 byte files that would fit on a DVD I used zip -s 4482m output.zip /source/directory

[kirkmc adds: I'm on the road with only my iPad, so I havent been able to test this.]
  Post a comment  •  Comments (8)  
  • Currently 2.33 / 5
  You rated: 2 / 5 (6 votes cast)
 
[20,678 views]  View Printable Version
Fix Dropbox Permissions Denied errors Apps
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.
  Post a comment  •  Comments (3)  
  • Currently 3.64 / 5
  You rated: 1 / 5 (11 votes cast)
 
[18,663 views]  View Printable Version
A way to review duplicates in Contacts Apps
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:
cut -f 2 -d '<' dupe_search.txt | cut -f 1 -d '>' | sort | uniq -c | grep -v "   1 "
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.]
  Post a comment  •  Comments (8)  
  • Currently 3.11 / 5
  You rated: 1 / 5 (9 votes cast)
 
[8,146 views]  View Printable Version
Use line breaks in Twitter Apps
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.
  Post a comment  •  Comments (3)  
  • Currently 2.63 / 5
  You rated: 3 / 5 (8 votes cast)
 
[7,298 views]  View Printable Version
Save Google Reader RSS feeds Apps
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.
  Post a comment  •  Comments (8)  
  • Currently 2.56 / 5
  You rated: 1 / 5 (9 votes cast)
 
[6,226 views]  View Printable Version
Use Siri to search Notes on iOS iOS devices
I have to admit, I neither use Notes on iOS, nor Siri, which, to me, is extremely unreliable. But I came across this hint on 52 Tiger which will be useful to those who do use them.

You may know that you can create notes with Siri, but you can also list your notes and search them. If you want to see all your notes, tell Siri, "Show me notes." You'll get a list of all your notes.

You can search notes, telling Siri, "Search notes for <search term>." Again, you'll get a list of your notes containing that term. Tap on the note in the list to open it.
  Post a comment  •  Comments (1)  
  • Currently 3.00 / 5
  You rated: 5 / 5 (12 votes cast)
 
[3,683 views]  View Printable Version