[AS] Saving a file without creating an idlk file
Hi there,
I have an AppleScript that open an InDesign template (indt), import a XML file and then save the document to another folder than the one where the XML file and the template are living.
The problem, and I don't see how to resolve it, is that InDesign always create a lock file (idlk) with the new document and I don't seem to find a way to close the new document.
Here's the script:
Translating:
chemin_fichier_xml == path_to_xml_file
chemin_gabarit_indesign == path_to_indesign_template
chemin_nouveau_fichier_indesign == path_to_new_indesign_file
on genere_fichier_indesign(chemin_fichier_xml, chemin_gabarit_indesign, chemin_nouveau_fichier_indesign)
tell application "Adobe InDesign CS4"
set ce_document to open chemin_gabarit_indesign without showing window
tell ce_document
tell XML import preferences
set import style to merge import
set repeat text elements to true
set import text into tables to true
set import CALS tables to true
end tell
import XML from chemin_fichier_xml
set le_nouveau_document to chemin_nouveau_fichier_indesign
tell ce_document to save to le_nouveau_document with force save
(* this will generate an error *)
-- try
-- close ce_document saving no
-- close le_nouveau_document saving yes
-- end try
end tell
end tell
end genere_fichier_indesign
TIA
Cheers
-Emmanuel