Odd indeed. Well in case anyone else encounters the problem, since the makers of iPhoto don't seem to want to (can't?) allow one to create new keywords, I've sort-of circumvented the problem by hijacking the "comment" property to serve as a keyword container instead. Only caveat is I have to manage it myself -- which is fine for my purposes. I know, not pretty but...
Bill's GUI scripting approach looks like it would do the job, but I'm concerned it would slow things down for my particular application. Nice though -- will keep this little gem on-hand and will compare the performance of using the hijack approach vs. GUI scripting approach.
What would be great in the AppleScript event subsystem is to have an option to make all GUI scripting "invisible" so the user doesn't see dialogs, menus, sheets etc. popping up all over the screen seemingly willy-nilly. Would be nice to have an option to just show a progress/busy circle/bar while all the *effects* of the GUI changes are performed "invisibly" with one GUI update at the end of the process.
But maybe I'm asking too much.
Best, dalmazio
On Sat, Dec 6, 2008 at 5:05 AM, Bill Cheeseman < email@hidden> wrote: on 2008-12-06 1:30 AM, Dalmazio Brisinda at email@hidden wrote:
does anyone know of a way to programmatically
create keywords prior to attempting to assign them?
You have to use GUI Scripting
... which is terribly lame, if you ask me, though better than nothing. The inability to do it otherwise is confirmed by a bit of Googling, e.g. http://discussions.apple.com/thread.jspa?threadID=1400218&tstart=780 : Yeah, adding keywords to iPhoto is one of the great pipe dreams of those who enjoy AppleScript. It has never been possible in any version of iPhoto,
which never ceases to amaze me.
Very odd that there's programmatic access to keywords with no "make new" support. Wonder what they did in the design to keep that from working? |