Applescripting insert image with excel
I hope I am in the right place for this post, its regarding Applescript
I have an applescript that does work for the most part. It places an image into a cell in excel for me, goes down a cell and then puts another image in that cell. The problem is that as it continuses down rather then placing it in the top left corner of the cell as I the script tells it to it gradualy lowers the images placment in the cell. after about 30 images the image well out of alignment and I have to go back and manually correct.
below is the script
Does anyone know what I am doing wrong here?
--choose master ss
set masterss to (choose file with prompt "select the master ss file")
set file_name to name of (info formasterss)
--choose main folder where jpegs are and keep
set jpegdir to (choose folder with prompt "select folder of thumbs") as text
tell application "Microsoft Excel"
activate
set vfxnamecolumn to 4
set vfxnamerow to 3
repeat
set newvfxnamerow to (vfxnamerow + 1)
set vfxnamerow to newvfxnamerow
if value of cell vfxnamecolumn of row vfxnamerow = "" then exit repeat
set cellxx to (value of cellvfxnamecolumn of rowvfxnamerow of active sheet)
set image_file to (jpegdir & cellxx & ".jpg") as text
set newPic to makenewpictureat the beginning of worksheet 1 of workbookfile_namewith properties {file name:image_file}
set left position of newPic to left position of cell (vfxnamecolumn - 1) of row vfxnamerow
set top of newPic to top of cell (vfxnamecolumn - 1) of row vfxnamerow
set height of newPic to 140
set width of newPic to 280
end repeat
end tell
2.16 intel core duo macbook pro, Mac OS X (10.6.1)