Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting text of indesign catalog to a database. 2

Status
Not open for further replies.

LordGarfield

IS-IT--Management
Jul 31, 2003
112
0
0
BE
Hi,

We have an old catalog in indesign but it is manualy created. Now we are planning to switch to database publishing. Is there a way to get all info out of an indesign document and import it to a excell file our even better a database?

we are gonna use mysql as a database.


best regards
Roel.

tank you,

(>" "<)
(='o'=)
-(,,)-(,,)-----
|LORD_GARFIELD|
---------------
 
On the Adobe Studio Exchange, there is a free script for exporting Excel files from InDesign tables.

'Export Table to Excel'

- - picklefish - -
Why is everyone in this forum responding to me as picklefish?
 
Well it are not actualy tables.

just a product number as a title. and then a textbox with some data in it. but this for about 600 products.

so copy paste it would take to much time.

tank you,

(>" "<)
(='o'=)
-(,,)-(,,)-----
|LORD_GARFIELD|
---------------
 
If the boxes are not threaded and have no distinct styles applied to them then you are in for a lot of re-typing.

Styles can be used to export XML but it is most likely that the catalog was not set up in a structured manner to allow this type of export. I am in the same boat with a catalog of my own.

- - picklefish - -
Why is everyone in this forum responding to me as picklefish?
 
There is a script (ExportAllStories) on the indesign CS cd, this script will export all stories to individual text files. Unfortunately this will only get you half way there. You will then need to find a way to import the text files into a spreadsheet or database, if you have experience programing this should not be a difficult task.

Perrin
 
Hi LordGarfield

You can use the 'Export' command under 'File' and then choose XML. This will make your layout comprehensible to a database. Creating, agging and mapping will be neededbut it can bedone if your database uses the same tags as the Indesign file. I just gave a 6 hour course on this matter, so you can not expect that I Wcan tell this in a reply to your question. Reading the help on the XML question can help you.

I know this is not a direct answer but the question is to complex, maybe I'll write a Faq on it?

carlow
 
hi,

when I export to xml I only get a floder images with nothing in it and an xml file with the folowing content

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Root></Root>

and that is it.

About exporting the story's
I can not find the export function. I'm using the trial version of cs.

mvg
roel.


tank you,

(>" "<)
(='o'=)
-(,,)-(,,)-----
|LORD_GARFIELD|
---------------
 
Creating, tagging and mapping will be needed...
...before you can export XML. You have nothing tagged right now. Either map paragraph/character styles to tags or create XML tags from scratch in InDesign.

- - picklefish - -
Why is everyone in this forum responding to me as picklefish?
 
Garfield

Copy the text below and and paste it into notepad or any other word processor and save it with the .js extension. Save the file to the folder "C:\Program Files\Adobe\InDesign CS\Presets\Scripts", run the file by double clicking it from the scripts pallet.

This is the JavaScript version and it should work for both windows and mac.

Good luck Perrin

//ExportAllStories.js
//An InDesign CS JavaScript
//
//Exports all stories in an InDesign document in a specified text format.
//
//For more on InDesign scripting, go to //or visit the InDesign Scripting User to User forum at //
if(app.documents.length != 0){
if (app.activeDocument.stories.length != 0){
with(myDialog = app.dialogs.add({name:"ExportAllStories"})){
//Add a dialog column.
myDialogColumn = dialogColumns.add()
with(myDialogColumn){
with(borderPanels.add()){
staticTexts.add({staticLabel:"Export as:"});
with(myExportFormatButtons = radiobuttonGroups.add()){
radiobuttonControls.add({staticLabel:"Text Only", checkedState:true});
radiobuttonControls.add({staticLabel:"RTF"});
radiobuttonControls.add({staticLabel:"InDesign Tagged Text"});
}
}
}
myReturn = myDialog.show();
if (myReturn == true){
//Get the values from the dialog box.
myExportFormat = myExportFormatButtons.selectedButton;
myDialog.destroy;
myFolder= Folder.selectDialog ("Choose a Folder");
if((myFolder != null)&&(app.activeDocument.stories.length !=0)){
myExportAllStories(myExportFormat, myFolder);
}
}
myDialog.destroy();
}
}
else{
alert("The document does not contain any text. Please open a document containing text and try again.");
}
}
else{
alert("No documents are open. Please open a document and try again.");
}
//myExportStories function takes care of exporting the stories.
//myExportFormat is a number from 0-2, where 0 = text only, 1 = rtf, and 3 = tagged text.
//myFolder is a reference to the folder in which you want to save your files.
function myExportAllStories(myExportFormat, myFolder){
for(myCounter = 0; myCounter < app.activeDocument.stories.length; myCounter++){
myStory = app.activeDocument.stories.item(myCounter);
myID = myStory.id;
switch(myExportFormat){
case 0:
myFormat = ExportFormat.textType;
myExtension = ".txt"
break;
case 1:
myFormat = ExportFormat.RTF;
myExtension = ".rtf"
break;
case 2:
myFormat = ExportFormat.taggedText;
myExtension = ".txt"
break;
}
myFileName = "StoryID" + myID + myExtension;
myFilePath = myFolder + "/" + myFileName;
myFile = new File(myFilePath);
myStory.exportFile(myFormat, myFile);
}
}
 
Hi...

Tank you for your great answer. I dit not test it yet becouse my trial version of cs is over. We ordered a version of CS but it is not shipped yet.

Any way. Another question.

What is the difrence between a story and a textframe?

I know it is a newbie question.

tank you,

(>" "<)
(='o'=)
-(,,)-(,,)------------------------------
LORD_GARFIELD
---------------------------------------
 
Someone else can probably explain it better than I can, the way I think of it is a textframe is a box that can contain text. A story is a group of text, a story can be contained in a textframe or it can flow through many linked textframes.

Let us know how it goes when you get your disk.
Perrin
 
Hello Kliot,

We finally have the cd set and I was very curious to see your javascript at work. It works great but for us unfortunately it is not really sufficient. The script generates alot of different text files without reference to each other or the page number they are coming from.
Most of the txt files contain nothing more than one word (title), a number (product number) or are even empty.
It would be great to have the txt files per page or even better per product. But maybe I am hoping too much that somebody else (his code) is going to structure my data? ;-) At the moment it is impossible for us to do something useful with the txt files.
Best regards,


tank you,

(>" "<)
(='o'=)
-(,,)-(,,)------------------------------
LORD_GARFIELD
---------------------------------------
 
Hi

maby try this:
save as PDF (using my script from AdobeShare - SerialPrintExport for separated files) and use FineReader to "read" ... I think, you could set him to read data as formatted text (as filled form) ...

Robin robiNET

Scripts for InDesign
gg 3753393
Skype: indesignscripts
 
Thank you Robin,

As a coincidence I just visited adobe share and saw your name popup several times in the indesign scripting section and wondered if I could use your script to help me out...I will try and let you know, thanks again!


tank you,

(>" "<)
(='o'=)
-(,,)-(,,)------------------------------
LORD_GARFIELD
---------------------------------------
 
Robin?

Does your script also works with indesign CS?

tank you,

tank you,

(>" "<)
(='o'=)
-(,,)-(,,)------------------------------
LORD_GARFIELD
---------------------------------------
 
sorry for asking a simple question but i am trying to decide if i should buy indesign. I have a catalog with several hundered products. It sounds like from your thread that i could create a database that would be linked to the print catalog. For example the database would have fields such as price, part number, description.

I could then reference or call out for the database to place these in a layout?
 
You can do this via scripting or via a dedicated catalog plug-in system. Cacidi, WoodWing, Em software and many others out there have plug-ins for catalog workflows.
 
LORD GARFIELD:

I must rewrite them ... and add new feature - export not only as single pages, but in packets - i.e. by 5, 16, 32 pages

robin

Scripts for InDesign
gg 3753393
Skype: indesignscripts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top