InDesign - CS2 and CS3 duplicate method is different?
InDesign - CS2 and CS3 duplicate method is different?
- Subject: InDesign - CS2 and CS3 duplicate method is different?
- From: "Gary Bielby" <email@hidden>
- Date: Mon, 1 Jun 2009 11:03:55 +0100
- Thread-topic: InDesign - CS2 and CS3 duplicate method is different?
Hi,
I asked a question about duplicating images from one document to another
that didn't exist on the local drive anymore.
Ed replied with the following:
>Rather than try to copy and paste an unlinked image from a box in one
>document to a box in another, I would suggest duplicating the box
>containing the image, to the other document, then setting the new box's
>properties to match the target box and deleting the target box.
That method works great with CS3 but the same code does not work with
CS2 - just wanted to post my method to see if anyone could see why....
(Before running this l've opened two documents with a rectangle labeled
'pic1' on both - l've only placed an image in doc 1's box)
property myDocuments : {}
set boxName to "pic1"
tell application "Adobe InDesign CS3"
-- Source
tell active document
set MyRectangles to page item boxName
set MyRectangle to item 1 of MyRectangles
set thePage to parent of MyRectangle
set thePageNumber to name of thePage
end tell
if (count documents) = 0 then
display dialog "Please, open a document" buttons "OK"
default button 1 with icon caution
else
repeat with d from 1 to count documents
set MyDocument to document d
set end of myDocuments to MyDocument
end repeat
end if
set docCount to the number of items in myDocuments
repeat with x from 2 to docCount
set proceed to true
set myPasteDocument to (item x of myDocuments)
tell myPasteDocument
-- Target
set MyTargetRectangles to page item boxName
set MyTargetRectangle to item 1 of
MyTargetRectangles
set theTargetPage to parent of MyTargetRectangle
set theTargetPageNumber to name of theTargetPage
set {y, x, l, h} to geometric bounds of
MyTargetRectangle
-- LINE ONLY WORKS IN CS3 not CS2
set MyTargetRectangleCopy to duplicate
MyRectangle to page theTargetPageNumber
-- DELETES FROM DOC2- CS3 and CS2 - OK
delete MyTargetRectangle
-- MOVE AND SET MOVES DUPLICATE ITEM on DOC1 -
SHOULD BE ON DOC2
-- LINE ONLY WORKS IN CS3 not CS2
move MyTargetRectangleCopy to {x, y}
set geometric bounds of MyTargetRectangleCopy to
{y, x, l, h}
end tell
end repeat
end tell
Regards, Gary.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden