Article View: adobe.scripting.indesign
Article #14791Re: storing multiple selections as one asset in library (AS)
From: Olav_Kvern
Date: Fri, 16 Jan 2004 20:40
Date: Fri, 16 Jan 2004 20:40
66 lines
2810 bytes
2810 bytes
steve--
Like so (in CS--this will not work in 2.x):
--MovePagesExample.as
--An InDesign CS AppleScript
tell application "InDesign CS"
--Set up two example documents.
set myDocumentA to make document
tell myDocumentA
make page
tell page 1
set myTextFrame to make text frame with properties {geometric bounds:{"6p", "6p", "18p", "18p"}, contents:"This is page 1 from document 1"}
end tell
tell page 2
set myTextFrame to make text frame with properties {geometric bounds:{"6p", "6p", "18p", "18p"}, contents:"This is page 2 from document 1"}
end tell
end tell
set myDocumentB to make document
tell myDocumentB
make page
tell page 1
set myTextFrame to make text frame with properties {geometric bounds:{"6p", "6p", "18p", "18p"}, contents:"This is page 1 from document 2"}
end tell
tell page 2
set myTextFrame to make text frame with properties {geometric bounds:{"6p", "6p", "18p", "18p"}, contents:"This is page 2 from document 2"}
end tell
end tell
--At this point, we have two example documents, each with two pages.
--Each page contains a text frame that identifies its origin.
--Create a new "destination" document.
set myDocumentC to make document
--Move the pages from myDocumentA.
tell myDocumentA
repeat with myPage in pages
my myMovePage(myPage, myDocumentC)
end repeat
end tell
--Move the pages from myDocumentA.
tell myDocumentB
repeat with myPage in pages
my myMovePage(myPage, myDocumentC)
end repeat
end tell
--Delete the blank page at the beginning of myDocumentC.
tell myDocumentC
delete page 1
end tell
end tell
on myMovePage(myPage, myDestinationDocument)
tell application "InDesign CS"
--Duplicate the page ("move" *really is* a "move" in that it
--removes the moved page from the original document)
set myClonePage to duplicate myPage
--Move the cloned page to the end of the destination document.
tell myClonePage
move to after page -1 of myDestinationDocument
end tell
end tell
end myMovePage
Thanks,
Ole
Technical Details
Message-ID:
<2ccf657e.7@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!webxReferences:
<2ccf657e.-1@webx.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,dc5f7c478108207d X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2004-01-16 13:07:54 PST From: Olav_Kvern@adobeforums.com Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: Re: storing multiple selections as one asset in library (AS) Message-ID: <2ccf657e.7@webx.la2eafNXanI> Date: Fri, 16 Jan 2004 12:40:26 -0800 References: <2ccf657e.-1@webx.la2eafNXanI> Lines: 67 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit