Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Duplicate a page (AS)

95 views
Skip to first unread message

Jim Heissenbuttel

unread,
Mar 11, 2003, 6:55:58 PM3/11/03
to
I am looking for a way to efficiently duplicate a page in InDesign using
AppleScript. Below is the script that does not seem to work.


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

Olav Kvern

unread,
Mar 11, 2003, 7:25:36 PM3/11/03
to
Jim--

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

0 new messages