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

Sript pour enregistrer tous mes fichiers Indesign en .idml

New Here ,
Nov 18, 2025 Nov 18, 2025

Bonjour, j'ai ce script, mais il y a une erreur :

/**
* Batch export .indd files to .idml
* Works in Adobe InDesign (via Scripts panel)
*/

(function () {
// Ensure a document isn't left open if something goes wrong
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;

// Choose folder
var folder = Folder.selectDialog("Choose folder with .indd files");
if (!folder) {
alert("No folder selected. Script cancelled.");
return;
}

// Get all .indd files
var inddFiles = folder.getFiles("*.indd");
if (!inddFiles || inddFiles.length === 0) {
alert("No .indd files found in the selected folder.");
return;
}

var failedFiles = [];

for (var i = 0; i < inddFiles.length; i++) {
var file = inddFiles[i];

try {
// Open document
var doc = app.open(file);

// Build .idml output path
var idmlPath = file.fullName.replace(/\.indd$/i, ".idml");
var idmlFile = new File(idmlPath);

// Export to IDML
app.activeDocument.exportFile(ExportFormat.INDESIGN_MARKUP, idmlFile);

// Close without saving changes
doc.close(SaveOptions.NO);

} catch (e) {
failedFiles.push(file.fsName + " – " + e);
try {
if (app.documents.length > 0) {
app.activeDocument.close(SaveOptions.NO);
}
} catch (_) {}
}
}

if (failedFiles.length > 0) {
alert(
"Finished with some errors:\n\n" +
failedFiles.join("\n")
);
} else {
alert("All .indd files were successfully exported to .idml.");
}
})();

TOPICS
Scripting
381
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
Explorer ,
Nov 18, 2025 Nov 18, 2025

Bonjour Frédéricd,

Je n'ai pas trouvé des erreurs. Ça marche bien.

Cordialement,

Funtom

 

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 ,
Nov 18, 2025 Nov 18, 2025

Merci de votre retour, alors c'est un problème d'emplacement ou de nom du dossier ? ?Capture d’écran 2025-11-18 à 12.08.51.png

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 ,
Nov 18, 2025 Nov 18, 2025

You saved the script file as an RTF file. Save it as a plain-text file and the script will run as expected.

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 ,
Nov 18, 2025 Nov 18, 2025

I don't understand it's a .jsx file

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 ,
Nov 18, 2025 Nov 18, 2025

.jsx is just a name. The problem is the file's content. Open it again in your editor, then save it as a text-only file.

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 ,
Nov 18, 2025 Nov 18, 2025

i opened it in text edit, save has rtf and renommed with .jsx, but it doesnot work

 

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 ,
Nov 18, 2025 Nov 18, 2025

Do NOT save it as an RTF. Save it as text-only.

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 ,
Nov 18, 2025 Nov 18, 2025

sorry i don't have acces to that format in text edit

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 ,
Nov 18, 2025 Nov 18, 2025

Strange. Are you sure? 

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 ,
Nov 18, 2025 Nov 18, 2025

in txt edit i put it in text, i convert it inrecorded it text format, registred it and then change the extension in the script folder but… 

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 ,
Nov 18, 2025 Nov 18, 2025

Dans TextEdit, tu vas dabs le menu Format > Convertir au format Texte.

Capture d’écran 2025-11-18 à 15.47.46.png

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 ,
Nov 18, 2025 Nov 18, 2025

oui c'est ce que j'ai fait, j'ai changé l'extension et puis aussi j'ai essayé de la laisser telle quelle, voilà avec quoi je me retrouve t cela ne fonctionne toujours pas

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 ,
Nov 18, 2025 Nov 18, 2025

Ton fichier de script doit avoir jsx comme extension. Le premier n'en n'a pas et le deuxième a txt.

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 ,
Nov 18, 2025 Nov 18, 2025

merci, le 1er surligné fonctionne, mais pas le 2e, ce qui n'a pas d'importance.
PAr contre ce que j'aurais aimé c'est de pouvoir lui indiqué mon disque dur et qu'il exécute le sript dans tous les dossiers et sous dossiers. Est-ce possible ?

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 ,
Nov 18, 2025 Nov 18, 2025

PAr contre ce que j'aurais aimé c'est de pouvoir lui indiqué mon disque dur et qu'il exécute le sript dans tous les dossiers et sous dossiers. Est-ce possible ?

Je ne connais rien aux scripts, désolé. Je t'ai juste mis sur la piste pour régler ton problème d'enregistrement de ton fichier TextEdit.

Mais je suis curieux : pourquoi as-tu besoin d'exporter tous tes fichiers inDesign en idml ?

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 ,
Nov 19, 2025 Nov 19, 2025

Bonjour, je n'ai plus les moyens de laisser des milliers d'euros à cet éditeur, j'ai acheté les 3 softs d'Affinity…

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 ,
Nov 19, 2025 Nov 19, 2025
LATEST

OK !

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 ,
Nov 18, 2025 Nov 18, 2025
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 ,
Nov 18, 2025 Nov 18, 2025

Ok thanks, the 1st one is ok (blue surligned), not the 2e one. It's not important.
What i would have like is that it runs on my whole hardrive and do the job for all the files in different folders. May be i'm dreaming ?
Thanks for your help

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