I have read through this thread (as well as a couple of others), and it appears that although what I think should be pretty simple, is pretty dang difficult. I want a window with a table that has a column on the left of thumbnail images, and a corresponding column on the right with the filename of each image. Here is the code I have been working with:
on will open theObject
set picture_table_List to {}
set thumb_Path to (path to pictures folder as Unicode text) & "somethumbs:"
tell application "Finder" to set all_thumb_Images to every file in folder thumb_Path
repeat with an_Image in all_thumb_Images
tell application "Finder" to set ai_Name to (an_Image's name)
set end of picture_table_List to {(thumb_Path & ai_Name), ai_Name} --
end repeat
set contents of table view 1 of scroll view 1 of window "main" to picture_table_List
end will open
As you can see, I set up a {two item} list of {filepath, filename} referencing a folder full of thumbnail images, and tried to put that into the table view. I also tried building the list using the Finder reference to the file instead of the filepath, but that did not work either. The table I created in IB has two columns, and I dragged the NSImageCell into the leftmost column, which created a very cool looking column of little windows. I had hoped that by trying to install the path into the cell, it would load up the image. Clearly, that is not the case.
What is really interesting, and probably informative, is that when I Build/Run this code, this shows up in the Run Log:
[Session started at 2006-12-01 22:19:45 -0800.]
2006-12-01 22:19:46.316 iPhoto CD Cataglo[2836] An uncaught exception was raised
2006-12-01 22:19:46.321 iPhoto CD Cataglo[2836] NSImageCell's object value must be an NSImage.
2006-12-01 22:19:46.325 iPhoto CD Cataglo[2836] *** Uncaught exception: <NSInvalidArgumentException> NSImageCell's object value must be an NSImage.
So, I know I need to have an NSImage instead of a filepath, but how do I get it?