Insert an image into AppleWorks DB

Does anyone know how to script the insertion of an image into the DB field of a AW database? With AW running, it is a drag and drop action, or copy and paste. I have tried copying to the clipboard from Image Events, but it won’t work. The field is fine and already defined as a multimedia field; there just seems to be no way to script the insertion of the multimedia data.

Any advice or assistance is appreciated.

casdvm

Jacques:

Thank you very much for the input. I will be working on this later in the week and report back to you.

casdvm

Jacques:

I cannot thank you enough. Your third script worked nicely with minimal changes. I would be very interested in how you discovered this method of issuing commands to AppleWorks and System Events to make this work so smoothly. I have been struggling for weeks to get this, and I have no clue how you came up with this bizarre sequence.

Here is the way it works to loop through a folder of images:

set x to choose folder--A folder full of image files.
set z to {}
tell application "Finder" to set xx to every file of folder x
repeat with y in xx
	set end of z to y as Unicode text
end repeat
--z is now the list of  image file references in Unicode format
tell application "AppleWorks 6"
	activate
	repeat with ii from 1 to count z
		tell document 1
			set current record to record ii
			select current record
		end tell
		tell application "System Events" to tell process "AppleWorks 6" to tell document 1 to keystroke tab --select  field 1 : multimedia
		
		tell document 1
			set this_image to (item ii of z) as alias
			insert this_image with fields {"Image"} --"Image" is  the name of the multimedia field
			make new record at end
		end tell
	end repeat
end tell

If you ever have time to explain this; please do so. I want all the gory details if I can get them.

casdvm