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

Make the computer sing happy birthday System
Here's a way to use AppleScript and the 'say' command to have the computer sing happy birthday to you. Enjoy!
set currentUser to long user name of (get system info)
set firstName to first word of currentUser
set lastName to last word of currentUser

set noteValues to {56, 56, 58, 56, 61, 60, 50, 56, 56, 58, 56, 63, 61, 50, 56, 56, 68, 65, 61, 60, 58, 50, 66, 66, 65, 61, 63, 61} -- F
-- set noteValues to {65, 65, 67, 65, 70, 69, 60, 65, 65, 67, 65, 72, 70, 60, 65, 65, 77, 74, 70, 69, 67, 60, 75, 75, 74, 70, 72, 70} -- D
-- set noteValues to {55, 55, 57, 55, 60, 59, 50, 55, 55, 57, 55, 62, 60, 50, 55, 55, 67, 64, 60, 59, 57, 50, 65, 65, 64, 60, 62, 60} -- E

set syllables to {"hap", "p", "birth", "day", "to", "you", "[[slnc 500]]", "hap", "p", "birth", "day", "to", "you", "[[slnc 500]]", "hap", "p", "birth", "day", "dear", firstName, lastName, "[[slnc 500]]", "hap", "p", "birth", "day", "to", "you"}

repeat with i from 1 to the length of noteValues
	set thisValue to item i of noteValues
	set thisSyllable to item i of syllables
	if length of thisSyllable is less than 3 then
		set speakingRate to 220
		set speakingRate to 100
	end if
	say thisSyllable pitch thisValue using "Cellos" speaking rate speakingRate modulation 0
end repeat

[crarko adds: Works as described. From the mind of Sal Soghoian. For extra credit tie it to an iCal reminder of a person's birthday, and see if you can put that person's name into the firstname and lastname variables and have it autoplay. A similar hint was also submitted by user 'Nyhthawk,' and I want to acknowledge that as well. Thanks!]
  Post a comment  •  Comments (10)  
  • Currently 4.17 / 5
  You rated: 5 / 5 (12 votes cast)
[10,330 views]  View Printable Version
Getting Software Update alerts as a standard user System
I have Mac OS X check for updates daily and automatically download any updates. However, only when I log in as an administrator do I get a dialog box informing of the existence of updates.

I wrote a short AppleScript to take care of the issue. Note that the script does not check for updates itself but relies on OS X's checking it in the background so it requires that the options to check for updates periodically and download updates automatically be checked in the Software Update preference pane.

Create the following script in the AppleScript Editor and save it as an application:
-- A script alerting non-administrator users about available downloaded
-- software updates

set updates_no to do shell script "defaults read /Library/Preferences/ LastUpdatesAvailable"
if (updates_no > 0) then
    set dialogResult to display dialog updates_no & " software update(s) are avalaible. Launch Software Update?"
    if button returned of dialogResult = "OK" then
      ignoring application responses
        tell application "Software Update" to activate
      end ignoring
    end if
  on error number -128
    -- The user canceled so do nothing
  end try
end if
Please, do not include any new line in the do shell command, otherwise, the script will fail. Add the script application to your standard account's Login Items.

From now on, whenever you login into that account *after* the automatic check downloaded new updates, a dialog bode informing you of the updates and suggesting to run Software Update for you is displayed. Of course, an administrator password is still required by Software Update.

This Script has been tested on Mac OS X 10.7.2 and detected the downloaded iTunes 10.5.3 update.

[crarko adds: I didn't have any updates available to try this with.]
  Post a comment  •  Comments (7)  
  • Currently 3.33 / 5
  You rated: 1 / 5 (9 votes cast)
[5,022 views]  View Printable Version
Change Finder sizes between Base 10 and Base 2 System
Ever since I found that Snow Leopard switched its file size calculations reported in the Finder from Base 2 to Base 10, I've been eagerly searching the Internet, trying to find a way to keep (or switch) between Base 10 and Base 2.

Download brkirch's switchDiskSizeBase from the author's website.

It's a command line program that works on OS X 10.6 (Snow Leopard) and 10.7 (Lion). From various posts I've read about the software, you may need to periodically download a newer version that will work in the event a Software Update breaks the functionality. However, the author appears to actively support it. The software is free and open source, but the author also accepts donations.

After downloading and unzipping the file you'll have a folder with the executable, and the source code and license. To run the program in Terminal, cd to that folder and type:

sudo ./switchDiskSizeBase

Enter your administrator password. You'll need to reboot to see the change. To switch back, just run the program a second time.

Here's a link to the discussion forum I found this hint from. I add the hint here because I have literally searched two years for a solution like this, but was only able to find this solution today. I'm sure more people will find the hint here on Mac OS X Hints than haphazardly finding the solution in an obscure forum like I did.

[crarko adds: I tested this on 10.7.2, and it works as described.]
  Post a comment  •  Comments (20)  
  • Currently 4.29 / 5
  You rated: 5 / 5 (7 votes cast)
[8,932 views]  View Printable Version
Adding and removing individual login items from Terminal System
As shown in this hint, there is a way to use the defaults command-line tool to add items to the Login Items list of the Accounts or Users & Groups System Preference panel:
defaults write loginwindow AutoLaunchedApplicationDictionary -array-add '{ "Path" = "/path/to/itemname"; "Hide" = 0; }'
Unfortunately, Apple provides no easy way to use defaults to remove a given login item from the list. While you can remove all login items by deleting AutoLaunchedApplicationDictionary, that's usually not what you want to do.

Luckily, there's another way to do it that does allow removal of individual items as well as other things.

A nice work-around solution is to instead use the osascript command-line tool to do it with simple AppleScript commands:

Add an item:
osascript -e 'tell application "System Events" to make login item at end with properties {path:"/path/to/itemname", hidden:false}' 
Remove an item:
osascript -e 'tell application "System Events" to delete login item "itemname"' 
List all items:
osascript -e 'tell application "System Events" to get the name of every login item'

[crarko adds: Note that the easiest way to get the path to the login item 'itemname' may be to open System Preferences » Accounts, click the 'Login Items' tab and then right-click (Ctrl+click) the name of the item. This displays a 'Reveal in Finder' submenu and you can determine the path from that.]
  Post a comment  •  Comments (4)  
  • Currently 3.00 / 5
  You rated: 5 / 5 (4 votes cast)
[20,053 views]  View Printable Version
A better List View in Stacks System
Enabling 'new list view' in Dock stacks allows you to manipulate the icons in a stack that is displayed in List View.

When viewing a Stack in Fan or Grid modes, you can manipulate the icons via drag-and-drop and invoke Quick Look by typing a space while hovering over the icon. However, these actions are not supported in the standard List View.

OS X 10.7 (and possibly earlier versions) supports a 'new list view' in which icons can be manipulated in the same ways as in the fan and grid views. It can be enabled via the Terminal command:

defaults write use-new-list-stack -bool YES && killall Dock

Also, when the New List View is in effect, icons sizes can be changed with the Command+Plus and Command+Minus key combinations.

To return to the default list view use:

defaults write use-new-list-stack -bool NO && killall Dock

[crarko adds: This worked for me in 10.6.8 as well.]
  Post a comment  •  Comments (8)  
  • Currently 3.44 / 5
  You rated: 5 / 5 (9 votes cast)
[8,510 views]  View Printable Version
Use the new iBooks fonts System
When Apple updated its iBooks e-book application to 1.5, they included some nice new fonts: Ahtelas, Charter, Iowan, and Servavek. With a little work, you can extract these from the application and use them on your Mac.
  • If you haven't already, download the free iBooks app from the App Store.
  • Locate the application in the Finder. (Select iBooks in iTunes and choose 'Show in Finder' from the File-menu. It will be named 'iBooks 1.5.ipa').
  • Make a copy of the file.
  • Change the file-extension of the copy from .ipa to .zip.
  • Extract the resulting zip-file by double-clicking on it. You will get a folder named iBooks 1.5.
  • In this folder open the Payload folder to find the app 'iBooks.'
  • Right or control-click on the application to show the contextual menu and choose 'Show Package Content.'
  • A folder will open with the font files in it. (The easiest way to locate them is to search the folder on .ttf.).
There are 16 font files in total; four for each font. Install them as you would do any font.

[crarko adds: Works as described. As always with fonts, be aware of copyright restrictions when making use of them.]
  Post a comment  •  Comments (12)  
  • Currently 3.67 / 5
  You rated: 5 / 5 (6 votes cast)
[10,546 views]  View Printable Version
Making Finder BeachBalls go away without rebooting System
Sometimes the Finder on my WiFi connected Mac will go into beachball mode because another computer on the home network is to old to respond to Airport's 'wake up' messages.

When a connectivity issue like that happens, the Finder is supposed to alert you with a 'Connections interrupted' dialog that gives you the opportunity to disconnect. However, it's a small dialog, and sometimes goes away by itself when perhaps it shouldn't.

If I miss the dialog, or click ignore, and leave that unavailable server on my desktop, any application that does a sloppy job of asking for information on mounted partitions can cause the Finder to hang.

That leaves Finder menu items such as 'Restart' or 'System Preferences' unavailable. The Apple Menu's 'Force Quit' keyboard shortcut still works, but often the unresponsive Finder will simply quit and never restart.

Fortunately, the Wi-Fi Menu on the right side of the Menu bar still works. You turn this on using the Network System Preferences pane.

Turns out that using that to turn off Wi-Fi, then waiting for a bit, and turning Wi-Fi back on clears the Finder's beachball, removes the old Mac from network visibility, and pretty much returns all functionality to normal.

There are lots of ways besides having an old Mac hooked to a network that could cause parts of a home network to become unresponsive. Toggling the Wi-Fi network connection can probably fix a lot of the problems they cause too.

If you want to see what happens to Lion's Finder when Wi-Fi becomes unresponsive, try turning off Wi-Fi from the Menu. As you try to use Apps normally, sooner, rather than later, you'll end up with a whirling beachball in the Finder, your Apps, etc.

[crarko adds: A lot of Finder related hangs are certainly due to Network errors that don't timeout in a reasonable period, based on my experience. Not all of them are, though, so this isn't a cure for all cases of the Beachball of Death, but it will handle a number of them. Note that in some cases the SystemUIServer (which handles menu extras like the Airport menu) will also hang, preventing access to the menu item. Then you're pretty much stuck with a hard reboot.]
  Post a comment  •  Comments (9)  
  • Currently 3.63 / 5
  You rated: 2 / 5 (8 votes cast)
[9,919 views]  View Printable Version
Quick Look using the arrow keys in full-screen mode System
I wanted to browse through my pictures with Quick Look using the arrow keys in full-screen mode, just like when viewing pictures/movies in a window.

You may have noticed that when you make a Quick Look image full-screen and then try to use up/down arrow keys to go through your pictures it doesn't work.

Here's how to get it working:

Instead of using Quick Look on a picture in a folder of images, use Quick Look on the actual folder (i.e. highlight the folder in Finder and press space).

Now switch to full-screen mode (either by menu zoom or pressing Cmd+Option+Y). You then need to open the folder. Like opening anything else in Quick Look this is the shortcut Cmd+down arrow.

Now press the right arrow key, and you'll see the first picture in the folder.

Up and down arrows will now work and let you move through your pictures full-screen.

[crarko adds: This works, but I found to be a little touchy in the step where you open the folder by pressing Cmd+down arrow. Sometimes the Mac just drops out of full-screen mode, and other times it works as described in the hint. Note: comments indicate this also works in Snow Leopard.]
  Post a comment  •  Comments (6)  
  • Currently 4.00 / 5
  You rated: 5 / 5 (8 votes cast)
[11,081 views]  View Printable Version
Change screen resolution on the command line System
At work, we run lots of tests for our product. We also reboot the headless minis after each reboot and want to with certainty that they are using the correct resolution. Our configuration management tool works best with command line applications. After searching around, I discovered that there isn't an application that could change resolution from the command line that was a native Intel binary.

I did find source to change resolutions, but it completely lacked any error checking and used APIs which were deprecated in 10.6 and absent in 10.7. I ended up writing a program that works on 10.6 and 10.7, has error checking, is released as a universal binary and is GPL code on github in hopes that others can use and help improve it.

Here is the download link for the installer package, and the source is available here.

Here's what it looks like when run:
$ screenresolution get
Display 0: 1280x800x32
$ screenresolution list
Available Modes on Display 0
  1280x800x8 	1280x800x16 	1280x800x32 	1280x800x30 
  1152x720x8 	1152x720x16 	1152x720x32 	1152x720x30 
  1024x768x8 	1024x768x16 	1024x768x32 	1024x768x30 
  1024x768x8 	1024x768x16 	1024x768x32 	1024x768x30 
  1024x640x8 	1024x640x16 	1024x640x32 	1024x640x30 
  800x600x8 	800x600x16 	800x600x32 	800x600x30 
  800x600x8 	800x600x16 	800x600x32 	800x600x30 
  800x500x8 	800x500x16 	800x500x32 	800x500x30 
  640x480x8 	640x480x16 	640x480x32 	640x480x30 
  640x480x8 	640x480x16 	640x480x32 	640x480x30 
  720x480x8 	720x480x16 	720x480x32 	720x480x30 
  720x480x8 	720x480x16 	720x480x32 	720x480x30 

$ screenresolution set 1280x800x32
Setting mode on display 0 to 1280x800x32

[crarko adds: I tested this using the installer package (in 10.7.2), and it works as illustrated above. The command is installed in /usr/local/bin by default, and required no additional fiddling to make it work. You can also build this from the available source code if you have Xcode installed.]
  Post a comment  •  Comments (8)  
  • Currently 3.86 / 5
  You rated: 3 / 5 (7 votes cast)
[20,562 views]  View Printable Version
If Spotlight does not find a file or a file's contents System
Sometimes Spotlight does not find a file or a file's contents when searching and re-indexing does not help with it.

The culprit was a wrong permission on the file, which was generated when saving it from one Mac to another via Go » Connect to Server. When trying to move such a file from one folder to another on the destination Mac, it always asked for the Administrator password.

It turned out that such file had permissions as 'Nobody Read and Write.' Adding the Administrator as Read and Write did not help to find it with Spotlight.

The workaround is to create a new folder, drag and drop the files or folders containing files that are not found by Spotlight, select this new folder, do File » Get Info and check Apply to enclosing items to change the permissions.

Like magic, a second later Spotlight finds such files and their contents.

What I do not know is if there is a way to automatically find and repair the permissions of such files, other than doing it manually on a one-by-one basis, or for the whole user account home folder.

[crarko adds: I can't say I've seen this particular one before, but it does seems logical that Spotlight wouldn't index a file that has no read permissions. The other question to ask is how the permissions got whacked in the first place.]
  Post a comment  •  Comments (10)  
  • Currently 3.80 / 5
  You rated: 4 / 5 (5 votes cast)
[30,854 views]  View Printable Version