Move records from AppleScript

I have a referene to a record, how do I move it into the folder named “2009”?

There is a move command. Also the record’s container property seems to be writable.

But how do I get a reference to the folder? Iterating over root folder?

You can get to the folder by name:

set _2009 to library record "2009" of root folder

Then to do the move:

set _record's container to _2009

It seemed so daunting that I didn’t try indexing…

Thanks!