Sunday, January 24, 2010

Fixing Aperture Vault Errors from Terminal

Apple's pro photo management application Aperture 2 is long overdue for an upgrade, and I hope that we'll see Aperture version 3 before long. But while I'm itching for new features and functions, Aperture 2 covers the bases for me, in spades. Aperture has a nice feature called Vaults, which lets you automatically back up your photo library with all metadata to an external drive or drives. Except when it doesn't. For whatever reason, I was having trouble saving to one of my vaults saved on an older external FireWire hard drive, and it was returning errors about not being able to create folders or write files. This sounded like a permissions problem, so I looked into it.

An Aperture vault is a "package" file in OS X, which means the file is a collection of folders and files, which appear in the Finder as a single file. The original Aperture library, the iTunes and iPhoto libraries, and files from applications like Keynote or Pages are like this. Note I'm using OS X Snow Leopard 10.6.2, but these instructions should work on Tiger or Leopard as well. Here's how I dealt with the error.

How to Refresh Permissions on your Aperture Vault

The first thing is to shut down Aperture. Since Aperture grabs the Vault file and holds it open, it might be locked. Looking at the MyVault.apvault file in Finder, I can see it's locked by doing cmd-I and digging around in the information panel.

Recursively unlock. Because you need unlocked files to perform permission settings, you can start by recursively unlocking a folder, like this. Use sudo if you are not logged or su'ed in as root (run "sudo bash" to do this but be careful), and you can unlock files in an entire volume by cd-ing to /Volumes first if need be. Of course you can do this in the Finder's information panel as well.

chflags -R nouchg /path/to/folder/MyVault.apvault

Set POSIX owner and group. Comparing to a working Aperture Vault, the basic permissions were your usual user account, and "staff" as the group. Change the owner to your account with the group as staff. The -R makes it recursive even inside the vault package file.

chown -R rcogley:staff /path/to/folder/MyVault.apvault

Set POSIX basic perms. After setting the owner and group, I set the vault's permissions to 777.

chmod -R 777 /path/to/folder/MyVault.apvault

After that, I re-opened Aperture, refreshed the Vaults, and it worked without a hitch. I hope this hint helps someone. Enjoy!

Monday, January 18, 2010

Rick's Picks (weekly)

  • Apple's iWork '09 Numbers spreadsheet is a versatile app with a lot of power available if you open your mind and don't expect it to be Excel. It does not quite do everything Excel does, but it handles UTF-8 well (where Excel does not and has never), and I take advantage of that often. I also love the formatting options and the multiple-sheets-per-document paradigm, but that is a different post. One challenge in both Excel and Numbers is how to handle fields with numbers with leading zeros. For instance, a part number 001234 will come out as 1234 when you import it from a CSV in either app, and lose meaning if the actual part must include the leading zeros. You can set a cell or column format in Excel as 000000, and this works the same way in Numbers, except the method's a little unfamiliar. How to Format a Part Number Field to Preserve Leading Zeros

    tags: apple, iwork, numbers, zeros, text, format


Posted from Diigo. The rest of my favorite links are here.

Friday, January 15, 2010

Handle Leading Zeros in iWork Numbers

Apple iWork Numbers Leading ZerosApple's iWork '09 Numbers spreadsheet is a versatile app with a lot of power available if you open your mind and don't expect it to be Excel. It does not quite do everything Excel does, but it handles UTF-8 well (where Excel does not and has never), and I take advantage of that often. I also love the formatting options and the multiple-sheets-per-document paradigm, but that is a different post.

One challenge in both Excel and Numbers is how to handle fields with numbers with leading zeros. For instance, a part number 001234 will come out as 1234 when you import it from a CSV in either app, and lose meaning if the actual part must include the leading zeros. You can set a cell or column format in Excel as 000000, and this works the same way in Numbers, except the method's a little unfamiliar.

How to Format a Part Number Field to Preserve Leading Zeros

Here's how to not maim your part numbers.

  1. Select your column to format, and open the Cells inspector.
  2. Select Custom Format from Cell Format then click Show Format.
  3. Give the format a name, and choose the base type.
  4. Delete whatever format is in there by default and drag up an Integers type lozenge.
  5. Open the disclosure triangle, and choose "Show Zeros for Unused Digits" and you will see the #,### change to 0,000. Click Show Separator to deselect it and remove the comma. Add two digits.
  6. Click OK to save and apply the format to the selected column.

If you set the format as 000000 for a field that includes six digit numerics with leading zeros, and a mix of text with numeric part numbers, such as:

001234

P098765

005544

R-09-PCX

... the latter will not be affected by the format, which is just the right behavior we need.

I hope this tip helps someone, because not being able to set this really drove me a bit batty. Enjoy!