Skip to main content
Participating Frequently
October 8, 2009
Answered

How to edit xml link?

  • October 8, 2009
  • 1 reply
  • 5017 views

First a few words about my context:

I received a layout made on a CS3 version of InDesign. Now I am trying to create a procedure to automate the production of several pdf based on this layout. Manually the process would be to open the layout; edit the xml link with each xml source and create a corresponding pdf...

First issue:

In CS4 when I want to manually edit the xml link, the opened dialog prevent me (xml files are in gray) to select xml files, is it a well-known issue? How can I avoid it?

Second question:

How to edit the xml link from script?

Last question - applescript question - :

How to skip application dialogs? Like "This document miss some links, would you continue?"

If you'd be able to help me, thanks in advance!

This topic has been closed for replies.
Correct answer Loic.Aigon

> I am not skilled at all with applescript. There is a lot of very good applescripters around here. You may refer to ADobe scripts examples, it's quite sure there is a relink example in it.

So I will try your javascript I think it's possible to call javascripts from applescript. I hope actually because there is no relink example with InDesign CS4.

Thanks again


There is a piece of code found on the net :

tell document 1 of application "Adobe InDesign CS3"
relink thisItemLink to someFileReference
update thisItemLink
end

1 reply

Loic.Aigon
Legend
October 8, 2009

Hi,

Depending on your needs, you may choose to

Manually :

1. Label an element of the layout (ex: a graphic frame labeled "Image");

2. Install xmljs library which is very cumfy to deal with XML without loading xml into Indesign.

Via scripting :

3. Process through the xml with the library and get back the datas your need (a picture file path for example)

4. Open the indesign document and proceed like this :

- Duplicates page one

- Proceed to changes on this duplicated page (graphic changes)

- Set the pdfExportPreferences.pageRange to the page name (as String);

- Export the page your document as PDF

- Continue

5. Either save or not the document, close it.

xmljs : http://xmljs.sourceforge.net/

But that's not applescript...

A+ Loic

poxdAuthor
Participating Frequently
October 8, 2009

Hi and thanks for your answer.

My issue is not about xml but moreover InDesign and its integration (or my misuse) with it. The layout I received is intended to be used against several xml files I generate on my side. What I have to do is to take the layout and run the following process for every xml file I generated:

1. Import the xml file into the layout (I'd like to edit xml link indeed instead of an import xml command as the import does'nt give me the same results sometime)

2. Export as pdf

Loic.Aigon
Loic.AigonCorrect answer
Legend
October 11, 2009

> I am not skilled at all with applescript. There is a lot of very good applescripters around here. You may refer to ADobe scripts examples, it's quite sure there is a relink example in it.

So I will try your javascript I think it's possible to call javascripts from applescript. I hope actually because there is no relink example with InDesign CS4.

Thanks again


There is a piece of code found on the net :

tell document 1 of application "Adobe InDesign CS3"
relink thisItemLink to someFileReference
update thisItemLink
end