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

Use Terminal's vi as default text editor System
I've always been a vi guy, but OS X GUI-based vi versions leave a lot to be desired. So for years I've put up with TextEdit as the default application when I double click a text file in Finder or an attachment in Mail. Until yesterday, that is. Using this old macosxhints forum thread as the base, I updated and modified the script to behave properly.

Double-clicking a text file now opens it in vi in a new tab in Terminal, opening Terminal if it's not already running (which is rare, as I usually have four or five tabs open all the time). Here's the script: Copy it into Script Editor, and save it as an Application called VI. To use your new application to open any text file, control-click on a text file and choose Get Info from the pop-up menu. Under Open With, at the bottom of the pull-down menu, is Other. Select that, and a window will open where you can choose your saved application (check the Always Open With box, too). I also checked the Change All box back in the Get Info window.

Unfortunately, the one thing I haven't figured out is how to get it to open without an input file, so to start a new text file I have to go to the Terminal and type vi filename. Please let me know if this script can be improved to handle that case, or in any other ways.

[robg adds: While I could make this script work for files on a one-at-a-time basis, I could not get the Change All solution to work -- regardless of how I specified the app, or set the file's extension, Change All had no effect. Only the selected file was modified to open with vi; a commenter on the queue review site had the same experience. If you know how to resolve that issue, please comment...]
  Post a comment  •  Comments (16)  
  • Currently 2.30 / 5
  You rated: 4 / 5 (10 votes cast)
[40,558 views]  View Printable Version
Use a super quick Kana syllabary switching shortcut System
This is a boon for those who have to write a lot of Japanese, as there is a lot of switching between the two syllabaries (Hiragana and Katakana). Aside from putting the Input Menu in the Menu Bar (System Preferences » International » Input Menu Tab » Turn on Kotoeri, and make sure Show Input Menu in Menu Bar is checked), and using the Command-Space Bar and the Command-Option-Space Bar shortcuts (System Preferences » Keyboard & Mouse » Keyboard Shortcuts; deselect Spotlight; select Input Menu), you can switch between Hiragana and Katakana on the fly by holding down Shift while typing.

As an example, typing in わたしは レイ です。requires Hiragana, Katakana, and Hiragana again. The quickest way to write this sentence starting from the US English Keyboard would be as follows (assuming you enabled the Command-Space Bar switching method:
  1. Press Command-Space Bar.
  2. Type the following keys: "watashiha " (including the trailing space).
  3. Hold down the Shift key to switch to Katakana, then type "REI ".
  4. Let go of Shift to switch back to Hiragana, and type "desu."
[robg adds: This worked as described; the Shift key toggles between the two syllabaries.]
  Post a comment  •  Comments (8)  
  • Currently 2.29 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (7 votes cast)
[14,126 views]  View Printable Version
Copy RGB or HEX color values from the Color Picker System
As one might know, Apple has included a system-wide application called Color Picker with OS X. You can call it in every application that supports it, like TextEdit or Color Picker allows you to modify colors, choosing colors from a color wheel, HSB sliders, etc. (More about the Color Picker.)

Problem: The Color Picker is a fantastic tool to select a color, but you can't copy the result for use in other programs. You can extend Color Picker with the free Hex Color Picker, but not everybody likes to receive a HEX code. What about copying the RGB values as text to insert them wherever you want?
read more (468 words)   Post a comment  •  Comments (8)  
  • Currently 2.57 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (7 votes cast)
[27,135 views]  View Printable Version
Clone Parental Control settings with Apple Remote Desktop System
The key to cloning parental controls with ARD is niutil, the command line utility for netinfo. This works for Tiger (and probably Panther), but will not work in Leopard as Apple has finally banished netinfo from Leopard.

Read on for the how-to...
read more (527 words)   Post a comment  •  Comments (1)  
  • Currently 1.57 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (7 votes cast)
[17,720 views]  View Printable Version
Assign one keyboard shortcut to multiple menu items System
You may have read the title to this hint and thought "Huh? How can that possibly work? How does the system know which command to run when you type the shortcut? And why would you want to do this?" A bit more explanation is required to see the benefit of this hint: it's for use with menu items whose names change after they've been selected.

In this case, I wanted an easier way to toggle the display of smileys off and on in iChat (because iChat replaces =$ with a "dollar sign smiley face," meaning that pasted code often looks quite odd). Disabling smileys is done with View » Messages » Hide Smileys. Easy enough to assign that to Control-S, for example, in the Keyboard Shortcuts tab of the Keyboard & Mouse System Preferences panel. But once you've hidden smileys, that menu item becomes Show Smileys, and the keyboard shortcut vanishes. On a lark, I tried assigning Show Smileys the same Control-S shortcut...
I was fully expecting OS X to tell me that I couldn't assign Control-S again, as it had already been assigned to another function in iChat. But no such error message appeared, as you can see in the image above. This works perfectly -- Control-S toggles smileys both off and then back on again.

This should work in any application that has menu items whose names change based on the status of the feature they control. However, I've only tested it in iChat -- and only on 10.5, so I'm not sure if this works in 10.4, too.
  Post a comment  •  Comments (5)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (5 votes cast)
[10,348 views]  View Printable Version
10.5: Put anything on the Dashboard System
Following up on the Numbers chart on the Dashboard hint, the same method can be applied to any data that you can take a picture of:
  1. Take a screenshot of the area with Command-Shift-4.
  2. Move the resulting Picture__.png file from your desktop (where it is saved by default) to a folder on your computer (the widget will break if the original is deleted/moved). I personally have mine in ~/Documents/Clippings.
  3. Drag the image to Safari and create a Web Clip in the usual way.
[robg adds: The main difference between this hint and the Keynote hint is that this image will be static -- it will obviously only reflect what you took a screenshot of. In the Keynote hint, if you modify the chart in Keynote, then the web clip image will change when you save the file (as long as you have the chart as the active slide when saving).]
  Post a comment  •  Comments (1)  
  • Currently 2.00 / 5
  You rated: 3 / 5 (9 votes cast)
[13,061 views]  View Printable Version
Possibly unfreeze a process with Activity Monitor System
I don't know why this works, but it does seem to work like magic: When you have an application hang, try launching Activity Monitor. When I do this, especially with hangs in Photoshop, within seconds, the application resumes. Sometimes I've waited and waited, as long as maybe 10 minutes or more, for an application to come out of the "beach ball" mode on its own. Then, after launching Activity Monitor, I would hear the hard drive churn, and the application would become responsive again.

This works on both my Mac Pro (Intel) and my PowerBook G4 at home. I have no clue why it works. I know it doesn't seem to make sense, why an application that monitors processes would have any effect on them. But it works like a charm many times. Of course, there are times when it doesn't work either, but it's worth a shot.

[robg adds: This is the first I've heard of Activity Monitor releasing an app from beach ball land through the simple act of running it. If anyone else has had similar experiences, please share.]
  Post a comment  •  Comments (26)  
  • Currently 2.00 / 5
  You rated: 3 / 5 (7 votes cast)
[25,692 views]  View Printable Version
Scroll through windows in Expos's All Windows mode System
I just noticed purely by accident that after invoking Expos's All Windows mode, I can roll the scroll ball on the Mighty Mouse and the selection 'cursor' (the one showing which window will become active) moves about the available windows in a predictable, if not intuitive, manner.
  Post a comment  •  Comments (4)  
  • Currently 1.88 / 5
  You rated: 1 / 5 (8 votes cast)
[7,098 views]  View Printable Version
Change the screen saver's idle time via AppleScript System
The settings in the Desktop & Screen Saver System Preferences panel are among several that don't stick when you move an OS X startup drive to a Mac that you've never connected the drive to before. These settings are at ~/Library » Preferences » ByHost », where 0011aa2233cc is the Ethernet ID of the Mac's primary Ethernet port (en0), also known as the MAC (Media Access Control) address, which is a number unique to each Mac.

The ByHost folder will gather a collection of plists for other preference panes, applications, etc., all with names containing the Ethernet ID specific to every Mac it's seen. One purpose for this is to allow you to have your user folder stored on a network, letting you have different preferences for each Mac that accesses that home folder. However, this makes it inconvenient when you have a utility drive that you connect to any number of Macs that those Macs haven't seen before. For instance, you'll see that the screen saver kicks in after the default 15 minutes of idle time after you start up the drive on the next Mac, regardless of what setting you chose when the drive was connected to the last Mac you used it with.
read more (248 words)   Post a comment  •  Comments (2)  
  • Currently 2.25 / 5
  You rated: 3 / 5 (8 votes cast)
[22,307 views]  View Printable Version
Simulating an encrypted physical disk in OS X System
I've always wanted to have a fully encrypted memory stick which when plugged in, OS X would automatically ask me for a password before mounting it. As far as I know (and from what tests I carried out), it's not possible to create an encrypted disk image and overwrite the entire device with it.

My solution involves placing a hidden encrypted disk image on a device, hiding the volume itself so it doesn't show up in the desktop, and applying a Folder Action to the /Volumes folder which takes care of mounting the encrypted image when the device is plugged in, and unmounting the device when the encrypted image is ejected.

No Terminal access necessary: an AppleScript droplet for preparing the device, the Folder Action AppleScript, and an AppleScript for restoring the device are provided here.

The scripts are tested in 10.5.1, but they really should work in Tiger as well. Only known issue: if you hit Cancel when asked for the password to mount the encrypted image, you will have to unmount the device through Disk Utility, as it's not accessible via the Finder. However, it's not hard to create a 'cleanup' AppleScript that does this.

[robg adds: Typically, I'd host these scripts on macosxhints as well. In this case, however, due to their complexity and the chance of their changing in the future, I'm leaving them linked via the external site. I haven't tested these scripts. One other solution to do this came up just yesterday -- TrueCrypt is a free program that's now available for OS X. Using TrueCrypt, you can apparently encrypt an entire USB memory stick, for instance. I haven't tested it, however (I believe it uses MacFUSE to do some of its magic).]
  Post a comment  •  Comments (6)  
  • Currently 2.00 / 5
  You rated: 3 / 5 (10 votes cast)
[8,093 views]  View Printable Version