. I can't delete the photos that cause it to crash because it crashes when I select them.
Have you tried to launch Aperture with the ⌥-key held down? That may prevent it from crashing when you select the images in the Browser, because it will not try to render previews. Hopefully you can delete the images this way.
Alternately delete the project containing the bad images without selecting the images. If you delete more images than you want this way, you can retrieve the other images from the Trash in the Dock.
Can you restore your Aperture Library from Time Machine to the state it were before you tried to import?
I rebuilt the library database but now all but a few of my albums have disappeared from my projects.
Have you also tried to repair the permissions on your Aperture library?
Cleared all filters in the Library inspector?
Have you tried to do a Repair as well as the Rebuild?
In addition to Leoni's suggestions, you can export the project which contain the bad images and then re-import it into a new library to see if it still crashes. If you still crash with those particular images, you can remove them from inside the Aperture package.
You need to navigate to the Aperture Library and right-click or control-click on the library. You can now navigate to the Masters folder and the Previews folder looking for those images. Copy those particular images to the desktop and then delete them from that folders.
Thanks for the suggestions Leoni and firstlaunch. I tried to repair permissions and cleared the filters, and I did a repair as well as rebuild for the database. After the repair it still kept crashing, so then I did the rebuild and that's when my albums disappeared.
I went into the Aperture library and removed the photos that were triggering the crash, but now there are some others that are triggering it. I'll keep going with that approach to clean them out and then reimport them.
Meanwhile is there any way to restore the albums? If I look in the Aperture->Database->Albums folder I see .apalbum files that correspond to all the lost albums, but if I double click on one of these, Aperture imports an untitled folder with 0 items. How can I reestablish the link to these?
Thanks for your help!