Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

10.6: Use a Service to toggle trash can off and on System 10.6
Snow Leopard only hintThis hint enables you to turn off (and back on) moving files to Trash when deleting files, thus deleting them immediately when the trash is off.

This hint takes advantage of the fact that if the .Trashes folder in a user's home folder is not accessible, Mac OS X ignores it and displays an immediate file deletion warning like the one seen at right.

Create a service in Automator that (via the top two drop-down menus) takes no input and is available in any application. Add a single Run AppleScript action that has following contents:
on run {input, parameters}
  do shell script "chown root ~/.Trash" with administrator privileges
  do shell script "killall Finder"
  return input
end run
Save the service as Bypass Trash. Create another service with the same properties and one AppleScript action, with the following contents:
on run {input, parameters}
  do shell script "sudo chown myusername ~/.Trash" with administrator privileges	
  return input
end run
Replace myusername with your short user name as defined in the Accounts System Preferences panel. Save this one as Enable Trash.

By running the Service in any application (Finder included), you can turn off (and back on) the Trash seamlessly. (Here's what it looks like in action.) Do note that when turning off the Trash, Finder must restart so as to take notice of the folder ownership change.

[robg adds: I haven't tested this one.]
  Post a comment  •  Comments (3)  
  • Currently 2.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[380 views] Email Article To a Friend View Printable Version
10.6: Open generic files in a preferred app via Services System 10.6
Snow Leopard only hintOften I need to edit text files that don't have any associated application. This usually occurs when I'm changing system configuration files. My original process was to Control-click on a file and then select Open with and then Other, and then search through the application folder for my text editor program. From another site, I learned that it is very easy to create Services with Automator in 10.6. So now I have a one-click process to open any file in my text favorite text editor.

Run Automator and choose the Service template. At the top right, change the drop-downs to read Service receives selected files or folders in any application. On the left, click Files & Folders in the Library column, then drag Open Finder Items (in the next column) into the work area on the right.

Change the Open With drop-down to your favorite text editor; you may have to click Other to find it. I use TextWrangler, which can open many types of files and also works well when passed a folder. Choose File » Save As from the menu, and give the Service a name. In my case, I called it Open with TextWrangler. The service will be saved in your user's /Library/Services folder.

Now you can Control-click (or right-click) on any file or folder, and at the bottom of the contextual menu, you can choose your new service.

[robg adds: This worked as described in my testing.]
  Post a comment  •  Comments (1)  
  • Currently 5.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[428 views] Email Article To a Friend View Printable Version
10.6: Enable some bundled Services in the contextual menu System 10.6
Snow Leopard only hintUnfortunately, a bug in Snow Leopard may mean you're not seeing all the Services you should see in the contextual menu that appears when you right-click on a document or a text selection. You can, however, make those Services appear in the contextual menu:
  1. Open the Keyboard System Preferences panel, and select the Keyboard Shortcuts tab.
  2. Select Services in left-hand column.
  3. Deselect and reselect the Services you wish to appear in the contextual menu.
After toggling, the selected Services now appear at the bottom of the contextual menu. Credit isn't mine -- I found the details of this bug in Rob Griffiths' write-up on Snow Leopard's Services.

[robg adds: I had totally forgotten I'd written about this bug, and it seems it's still present in 10.6.2 (as tested on a new install here). It's also a bit more complex than I originally stated -- there are some Services that, even though they'll show in the Services menu, won't show in the contextual menu even after the above trick. It's not clear what the logic is for what will or will not show up, so you'll need to experiment a bit.

To demonstrate the problem, select some text in TextEdit, and then Control-click on the selection. Any relevant Services should appear at the very bottom of the menu, including two Mail-related entries (New Note With Selection, New Email With Selection) and one for Stickies (Make New Sticky Note). If you don't see them, perform the above toggle trick, and they'll miraculously appear.]
  Post a comment  •  Comments (3)  
  • Currently 4.33 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (12 votes cast)
 
[2,082 views] Email Article To a Friend View Printable Version
10.6: Avoid slow and CPU-intensive Time Machine backups System 10.6
Snow Leopard only hintOn my Mac, Time Machine backups sometimes slow to a crawl, and stay like that for hours on end. After some digging, I discovered that Finder is often the culprit, and quitting Finder seems not to have any adverse impact on the backup -- but it does speed it up by an order of magnitude. Here's what happened in my case...

I had been making an initial Time Machine backup over a network. Initial write speeds were over 5mbps, but an hour later, it was down to 100kbps -- and CPU usage went up to almost 90%. I left it this way for four hours and there was no improvement -- at this rate, the backup would take a week.

A look at Activity Monitor showed almost all the CPU usage due to Finder, and a look at the 'Open Files and Ports' by Finder showed it accessing the Applications folder in the backup, crawling through all the application packages over and over again.

Fed up, I quit Finder and suddenly backup speed went back over 5mbps -- and the backup finished absolutely fine.

I don't know what Finder was doing, but it doesn't seem like anything crucial (I didn't notice anything in the logs). This was only seen on Snow Leopard, and over a network (although this happened to me with a FireWire backup device as well.).

[robg adds: I haven't seen this on my Macs, but if you're having Time Machine backup issues, it might be worth a look.]
  Post a comment  •  Comments (6)  
  • Currently 4.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[2,921 views] Email Article To a Friend View Printable Version
See battery percentage in Terminal and GeekTool System 10.6
I have been building up a number of commands that I can use in GeekTool. One that I wanted but couldn't find in other lists was the current battery capacity. This works for me:
ioreg -l | grep -i capacity | tr '\n' ' | ' | awk '{printf("%.2f%%", $10/$5 * 100)}'
[robg adds: This worked as shown on my 10.6.2 on my MacBook Pro. To get it work in 10.5, though, I had to modify the command a bit; I found that this version works in 10.5:
ioreg -l | grep -i capacity | grep -v Legacy| tr '\n' ' | ' | awk '{printf("%.2f%%", $14/$7 * 100)}'
Note that the output above is set up for GeekTool, where you don't want a newline. If you want to run this in Terminal, you can change the printf bit (in either version) to read ...2f%%\n..., which will add a line break at the end.]
  Post a comment  •  Comments (10)  
  • Currently 4.67 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[2,409 views] Email Article To a Friend View Printable Version
10.6: Let Time Machine backup File Vault while logged in System 10.6
Snow Leopard only hintIt bugs me that Time Machine won't backup my encrypted home folder, provided by File Vault, while I'm logged in. I rarely log out of my account, and that makes Time Machine pretty useless in my opinion. I wanted some way to create a backup while logged in.

I'm more concerned about my laptop being stolen than my backup drive, since it's sitting in my closet, attached to my AirPort Base Station. So the fact that the backup won't be encrypted with this hint is no big deal for me. As a side effect, it makes single file restoring much easier. (One caveat being that Time Machine complains that it can't find the original location of the file, since it treats the home folder as a disk and not a path on the startup disk. You need to manually select that.)

To sum it up: I need my home folder to be encrypted. I don't need my Time Machine disk to be encrypted (but I'm sure someone can come up with a way to accomplish that, too.) Read on for the how-to...
read more (374 words)   Post a comment  •  Comments (5)  
  • Currently 4.62 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (13 votes cast)
 
[3,482 views] Email Article To a Friend View Printable Version
10.6: Set time of deletion for files placed in the Trash System 10.6
Snow Leopard only hintTo make it easier to retrieve accidentally-deleted items from the trash, you can use an Automator workflow and the third-party Automator action Touch Files to create a "date deleted" time stamp on files placed in the trash. Here's how:
  1. Download the Automator action and unzip it.
  2. Open Automator and import this action (File » Import Actions and navigate into the Touch Files folder to find the Action).
  3. Create a new Folder Action workflow in Automator.
  4. Click the Choose Folder pop-up at the top of the workflow, and select Other. When the file choice dialog appears, type Shift-Command-G, then type ~/.Trash/ and click Choose.
  5. Drag the Touch Files action (you can find it under Files & Folders) into your workflow. I recommend checking the Apply to contents of folders option, otherwise if you delete a folder, its files' modification date will remain unchanged.
  6. Save the Folder Action with a relevant name (Set Modification Date or whatever).
Now when you add a file to the Trash, its modification date will change. Sort the Trash window by date modified, and your most recently deleted files will be at the top.

[robg adds: This worked very well in my testing -- just make sure you give the workflow a second or two to run before checking the modification date. It worked on both files and folders with the option checked as described above. This is a nice solution to finding the most-recent of multiple similar/identical files you've deleted. One caveat: this will only work for files you delete from your boot drive; if you have other drives connected, items deleted from those drives actually go into a different folder (/Volumes/volume_name/.Trashes/501). I'm not sure if there's an elegant solution for handling any arbitrary connected drive or not...readers?]
  Post a comment  •  Comments (6)  
  • Currently 4.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
 
[2,567 views] Email Article To a Friend View Printable Version
10.6: Re-enable Java 1.4.2 and Java 1.5 apps in Snow Leopard System 10.6
Snow Leopard only hintMany applications that relied on Java 1.4.2 and Java 1.5 stopped working in Snow Leopard, because Apple removed these Java versions from the system. Upgrading to the lastest versions of many applications usually will solve the problem. However, your favorite application may not have a Snow Leopard compatible upgrade. For these applications, re-installing Java 1.4.2 and/or Java 1.5 is necessary. Sometimes, even this is not enough. As an example, Apple also removed the Cocoa-Java bridge from Snow Leopard, which some Java applications such as PDFLab depended on. Reinstalling the Cocoa-Java bridge along with the proper version of Java is necessary to re-enable these applications on Snow Leopard. For example, getting PDFLab working again in Snow Leopard requires reinstalling Java 1.4.2 and the Cocoa-Java bridge. Read on for a how-to...
read more (214 words)   Post a comment  •  Comments (5)  
  • Currently 4.14 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (7 votes cast)
 
[3,828 views] Email Article To a Friend View Printable Version
10.6: Make some open source screen savers work in 10.6 System 10.6
Snow Leopard only hintOne of the major annoyances about Mac OS X 10.6 is that screen savers now have to be compiled as 64-bit to work. This means that any old screen savers that you may have collected will now appear in gray in the Desktop & Screen Saver System Preferences panel. If you try to select these grayed-out entries, the system will tell you that the screen saver is incompatible, and ask you if you want to move it to the Trash.

Many screen savers are no longer in development, but worked just fine in 10.5. If you have a screen saver that you liked in Leopard but that no longer works in Snow Leopard, first see if the developer has released a Snow Leopard version, or is working on one. If the developer seems to have abandoned the project, as so many do, see if he has made these screen saver open source.

For example, this port of XScreenSaver, which contains over 200 screen savers from Linux, has both binary and source available for download. The binaries are compiled for 32-bit and work just fine in Leopard, but they will not work in Snow Leopard.

The solution is quite simple: you can recompile them yourself in 64-bit mode.
read more (271 words)   Post a comment  •  Comments (4)  
  • Currently 2.44 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (9 votes cast)
 
[3,395 views] Email Article To a Friend View Printable Version
10.6: Another way to view any text file in Quick Look System 10.6
Snow Leopard only hintIn Leopard, for Quick Look to display the contents of a text file, its extension had to be 'registered' with its UTI in the Info.plist file of the application associated with the file extension (see this hint). For most file endings associated with applications, this already works out of the box (in short, for all files with a Finder icon). This still seems to apply to Snow Leopard, but there is another option which might be new to Snow Leopard.

To make the file Quick Look-able, one simply has to set an extended attribute identifying the file as a text file. The necessary attribute is com.apple.FinderInfo with the value TEXT!Rch. Setting extended attributes can be done via with the xattr command in the Terminal. Note that xattr is technically a script and not a shell command, and thus does not have a man page, but help is available with xattr -h.

In my testing, I was only able to set the value in hex format. For a file named foo.goat this looks like this:
xattr -wx com.apple.FinderInfo '54 45 58 54 21 52 63 68 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' foo.goat
Interestingly, TextWrangler already sets this attribute with the 'correct' value, SubEthaEdit and TextEdit do not.
  Post a comment  •  Comments (10)  
  • Currently 2.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
 
[2,661 views] Email Article To a Friend View Printable Version