There are a number of posts on the internet that describe how to set iTunes album artwork from a file using AppleScript. Most of these first convert images to PICT using Image Events and then use this to set the album artwork data. With recent versions of iTunes it is unnecessary to convert JPEGs prior to setting the album artwork. In fact, the PICT-based approach will no longer work.

Fortunately, setting artwork is now relatively simple:

tell application "iTunes"
    set f to POSIX file "/path/to/my/artwork.jpg"
        set data of artwork 1 of current track to (read f as picture)
    end try
end tell