Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Multi-page InDesign document to single-page InDesign documents script?

New Here ,
Jun 10, 2008 Jun 10, 2008
I'm looking for a script that can take a multi-page Mac InDesign CS2/CS3 document and split it into single-page InDesign documents. Any ideas or comments?
TOPICS
Scripting
5.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Jun 10, 2008 Jun 10, 2008
Oh gosh, I wrote for my own use a script quite similar to the export pages from acrobat. I forgot it but I know it wasn't totally stabilized.
I will try to find it back. It could be a start for you.
Loic
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 10, 2008 Jun 10, 2008
Try one of these:
Peter Kahrels Batch-convert/export files:
http://www.kahrel.plus.com/indesignscripts.html

or at InDesigSecrets:
http://indesignsecrets.com/page-exporter-utility-peu-5-script-updated-for-cs3.php

or try to search this forum for PDF Export ;-)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 10, 2008 Jun 10, 2008
My converters won't do what Mike wants.

Peter
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Jun 11, 2008 Jun 11, 2008
Hi all,
Ain't got the time to find back what I have done but I couldn't take my mind at rest this morning. Moreover, I guess the code to write is not really difficult although heavy. So I tried to write it.
But I am worried.
My first thought is to "duplicate" the actual file, then delete all unecessary pages, save as a copy with an appropriate name, then undo and keep on processing with the next page.
However, so far the only way to remove the pages seems to consists in a loop through an array of pages while removing them. Considering that I will finally undo, it represents a lot of unuseful tasks.
I imagined that I could just select the icons of the pages in the pages panels then just delete it. So it would be only one action to delete and one action to undo. Unfortunately I don't see any way to talk to the pages panel.
app.pagesPanel produces error all the time and anyway I don't see any instruction for selecting the paes into it and later to handle them.
Any ideas ?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 11, 2008 Jun 11, 2008
Another approach (not tried):

Do with each page:
1. Override master items
2. Duplicate all textframes in situ, label them "duped"
3. Move "duped" frames to new document
4. Save document

Or something similar. Master items need to be overridden to ensure that running headers with page numbers and things that that are included.

Peter
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Jun 11, 2008 Jun 11, 2008
Hi Peter,
That's a option. Maybe there is no ideal approach. Each solution having its own potentials and wicknesses.
Leading this way, don't we loose layers, rulers, stuff that we might need ?
Loic
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 11, 2008 Jun 11, 2008
Loc,

>Leading this way, don't we loose layers, rulers, stuff that we might need?

That's true. But by the time you save a document page by page i doubt that they are needed. Anyway, they could be included as well I guess.

Peter
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Jun 11, 2008 Jun 11, 2008
Hi Peter,
You may be right. After all, this export script may be used only in a final term where no more modifications are really wanted.
Actually, we can really wonder the even need of this action. I mean why to create separate indesign if there is no further modification.
Maybe Mike should rather export pages to individual PDFs.
This kind of export to pdf script is quite common on the web.
Mike, what do you think ?
Loic
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 11, 2008 Jun 11, 2008
Yes, I do have the export to PDF script, and it works great, but, we have this speciality project that requires these multiple page InDesign docs we receive to be separated into single page docs for this project. It would be great if the script could also contain the ability to split these multiple page docs into specified page ranges also. Would this be possible also?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Jun 11, 2008 Jun 11, 2008
Hi Mike,
Page range is not a issue. What matters most now is to determine the smartest process to achiev your task.
The quickest seems to be Peter's one cause operations are limited in time but it implies to add code for page setup consideration, pageitems positions...
My way is more faithfull cause we just drop the pages we don't need but it asks for a lot of repetitive actions that are going to slow down the script in a way I can't even represent myself specially if you have a big document. On the other hand, your files are perfect clones.
Nevertheless, It would probably need control loops for removing masters that are not used anymore, colors, etc. Or the file may be uselessly weigth.

So if you are certain not to need specific modifications of the sperated pages, we should develop Peter's reflexion. Or if the pages must be workable template with masters, rulers and any other things that you don't want to reproduce every time, we may have to go my way.

Loic
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 11, 2008 Jun 11, 2008
This script seems to do the job: create a document with the same dimensions as the original (called "temp" here), then duplicate a page from the source document to temp and save temp. Continue with remaining pages. "Start" and "stop" are the first and last pages of the range to be saved. The script doesn't deal with section prefixes.

start = 102;

stop = 112;

doc = app.activeDocument;
tempdoc = create_temp (doc, 'temp');
docname = String(doc.fullName).replace (/\.indd$/, "");
for (i = start; i <= stop; i++)
{
$.writeln (i);
doc.pages.item(String(i)).duplicate (LocationOptions.before, tempdoc.pages[0]);
tempdoc.pages[1].remove();
tempdoc = tempdoc.save (File (docname + '-' + String(i) + '.indd'))
}
tempdoc.close (SaveOptions.no)

function create_temp (doc, n)
{
var temp = app.documents.add ({name:n});
with (temp.documentPreferences)
{
pageHeight = doc.documentPreferences.pageHeight;
pageWidth = doc.documentPreferences.pageWidth
}
temp.importStyles(ImportFormat.paragraphStylesFormat, File (doc.fullName));
return temp
}


Peter
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Jun 12, 2008 Jun 12, 2008
Hi, Peter and Mike,
I wrote the dialog for using your script. It just needs to be linked now.
Here is the dialog. With a little help from you guys, we could get a satisfying result.
http://minilien.com/?bplmVXMlpX
Loic
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 12, 2008 Jun 12, 2008
Peter,
I'm not a scripter and was wondering if you could link Loic's script with yours. Is this possible?
Thanks for everyone's input and work on this script.
Mike
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 12, 2008 Jun 12, 2008
Probably. As Loic said, his script provides an interface. Do you need one? If yes, Loic is welcome to add my script to his interface.

Peter
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 12, 2008 Jun 12, 2008
Peter,
Yes, an interface would be great.
Loic, can you add Peter's script to your interface?
Mike
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Jun 12, 2008 Jun 12, 2008
Hi Mike, I will give a try. It only really depends on my amount of work these days, I can't warranty quick action. I am not myself a great scripter so I have first to fully understood Peter's logic before linking to the dialog.
Will do my best on this topic as soon as possible.
Loic
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 12, 2008 Jun 12, 2008
The script doesn't really need an interface. All you need to do is enter the range of pages that need to be saved as separate ID docs: at start, the first page of the range, at stop, the last one. That's all. An interface would just pop up a dialog asking you to enter the first and last pages of the range.

Peter
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Jun 13, 2008 Jun 13, 2008
Hi Peter,
I guess dialog is not such indispensable if the script is used only once in a year.
However, as Mike does not know scripting and in case he needs to use the script quite often, it may be convenient to use a dialog. Besides, it could be interesting to take advantage of a dialog for specifying separation and removing options such as acrobat offers to.
I thought this morning that maybe I could add a checkbox implying either the files are automatically saved in the genuine folder or allow the user to point a specific folder.
Most of all, I worked a little on this topic a few months ago for my own purpose before I misteriously abandoned it. So I have a special interest to achieve this script.
Just to know, when you mean dialog is not useful. It implies that if you want to specify the range, you have to open the script in a text editor then save it and finally launch it from Indesign, that's right ?
Loic
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 13, 2008 Jun 13, 2008
Loic,

I didn't say that a dialog wouldn't be useful, just that it didn't seem necessary. As I said, all he needs to do is change two numbers and press F5 to run the script. Interfaces usually take much more code than the functional part of the script (the interface you wrote, linked in post 12, is about three times bigger than myscript!) so I don't bother with them for myself.

Anyway, Mike has a working script now. If he wants a fancy interface to go with it, maybe he should offer you to pay for it.

Peter
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Jun 13, 2008 Jun 13, 2008
Hi Peter,
No offense, don't worry. You know I am surrounded with code engeneers. I am well placed to know that sometimes they have a really cartesian point of view. If it's not logical for them, it can't be for anyone :-)
But as I am more of a end user, I am more asking for ergonomic stuff. Probably weighter but so cumfy when using it.
If I was paid, I should have to refund you for 75% of the amount :-)
Loic

Mike, I will give a try but I can't warranty you any term.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 13, 2008 Jun 13, 2008
Peter,
I'm not sure how to run your script. I really didn't understand your previous instructions. I edited your script by entering start=1; and stop=10 and put the edited script in the script folder within InDesign application. I opened a multiple page InDesign document containing 30 pages. I then double-click the script in the script palette hoping to see 1-10 pages extracted from the 30 page document, but nothing happens. Could you explain what I'm doing wrong and where the extracted pages would be saved to? I'm very new to using scripts in InDesign.
Loic,
Adding a checkbox option to the interface for saving the split documents to specific folder would be great. We plan on using this script many times a year and yes, once this is completed, I plan on paying both Peter and yourself for your hard work on this. Thanks again, Mike
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 13, 2008 Jun 13, 2008
Mike,

>I really didn't understand your previous instructions.

There weren't any, I don't think :)
What you did was correct -- what goes wrong is not so clear. What should happen is this: say the document from which you want to save pages as individual files is called 'test.indd', and that you want to extract pages 1 to 10. The script should create ten new files, named test-1.indd, test-2.indd, ..., test-10.indd, all in the same folder as test.indd. These documents aren't kept in memory.

As to what goes wrong, that's less clear -- it works fine over here. The script works in CS3, not CS2, but you must use CS3 because in CS2 it would generate an error. Do you use section prefixes for the numbers? That could be a problem (easily solved). Maybe you could send me a document, that way it's easier for me to see what goes wrong.

Peter
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 13, 2008 Jun 13, 2008
Peter,

I don’t know if this email will get to you, but I’ve attached a compress IND doc for you to test your script on. I did get the script to generate the desired range  of pages to be extracted, but these extracted pages are blank when I open them. Let me know if you get the same results.

Thanks, Mike
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 13, 2008 Jun 13, 2008
Mike -- I didn't receive anything. You need to send it to the address you see when you click my name.

Peter
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines