Hi,
Just wondering if anyone can help... l'm trying to
copy/paste images from one document to another.
I've been doing this my getting the file path of item link
of graphic 1 and then doing a place on the other document - then setting the offset
etc to move it to the correct place - which works great. (see below code)
The problem l have got it sometimes the original image file
doesn't exists so it does not work - what l want to do is copy the 'preview'
image you see on the document and paste that in the box on the other document -
just like a normal copy/paste without having to have the original image on the
local drive
Any ideas on a nice way of doing this?
This is my current copy/paste methods l talked about:
on copyItem(boxName)
try
tell application "Adobe
InDesign CS3"
set
myCopyDocument to active document
set
proceed to false
tell
myCopyDocument
set theSelection to graphic 1 of page item boxName
set theTarget to parent of theSelection
set FilePathOfImage to file path of item link of graphic 1 of theTarget
set {a, b, c, d} to geometric bounds of theSelection
set {w, x, y, z} to geometric bounds of theTarget
set xOff to a - w
set yOff to b - x
end
tell
return {true, FilePathOfImage, xOff, yOff}
end tell
on error msg
display dialog "Can not copy original image: " & msg
return {false, "", 0, 0}
end try
end copyItem
on pasteItem(boxName, FilePathOfImage, xOff, yOff)
tell application "Adobe InDesign CS3"
try
tell
myPasteDocument
set myImage to place FilePathOfImage on page item boxName
set {a, b, c, d} to geometric bounds of myImage
set geometric bounds of myImage to {a + xOff, b + yOff, c + xOff, d + yOff}
end
tell
on error msg
display dialog "Can not place original image: " & msg
end try
end tell
end pasteItem
Regards, Gary.