tell application "InDesign 2.0.2"
tell document 1
set myNewPage to make page at end of document 1
end tell
tell page 1 of document 1
select all page items
copy
end tell
tell page 2 of document 1
paste
end tell
end tell
Any ideas would be appreciated.
Jh
If you're actually trying to duplicate the entire page, try something like this:
--DuplicatePages
set mySourcePageNumber to 1
set numberOfPages to 3
tell application "InDesign 2.0.2"
tell active document
repeat numberOfPages times
set myNewPage to duplicate page mySourcePageNumber
end repeat
end tell
end tell
If you're trying to duplicate page items from one page to several other pages, try something like this:
--DuplicatePageItems
set mySourcePageNumber to 1
set myTargetPages to {2, 3, 4, 5}
tell application "InDesign 2.0.2"
tell active document
set ruler origin of view preferences to page origin
set zero point to {0, 0}
repeat with myCounter from 1 to (count myTargetPages)
set mySourcePage to page mySourcePageNumber
try
set myTargetPage to page (item myCounter of myTargetPages)
on error
set myTargetPage to make page at end
end try
repeat with myPageItemCounter from (count page items of mySourcePage) to 1 by -1
set myClone to duplicate page item myPageItemCounter of mySourcePage
copy geometric bounds of myClone to myBounds
tell myClone
move to myTargetPage
set geometric bounds to myBounds
end tell
end repeat
end repeat
end tell
end tell
Does that help?
Thanks,
Ole