doc.packageForPrint no runs

Explorer ,
Jan 12, 2021 Jan 12, 2021

Copy link to clipboard

Copied

Hi all,

 

i wrote an extendscript tha I use in a CEP 6 extension first ; as you know I get migrate my CEP  extensions from 6 to 9th version. So this track code don't run in InDesign 15.

Does anyone have an idea about this ?

 

thanks

 

Americo

 

///// here is the code

function pacKage(arg) {
    var parentFolder = "/" + arg.share + arg.pkg + arg.id + "_" + arg.number;
    var getFabFolder = parentFolder + "/PRIS";
 
if ( !createFolderIfNotExist(parentFolder) ) {
    alert("Erreur de création du dossier " + parentFolder + ", sortie...");
   exit(0);
}
 
if ( !createFolderIfNotExist(getFabFolder) ) {
    alert("Erreur de création du dossier " + getFabFolder + ", sortie...");
    exit(0);
}

var targetFolder = new Folder (parentFolder + '/' + arg.name);
alert('[opensession.jsx] - targetFolder : ' + targetFolder);

if ( !createFolderIfNotExist(targetFolder) ) {
    alert("Erreur de création du dossier " + targetFolder + ", sortie...");
    exit(0);
} else {
var doc = app.activeDocument;
 
doc.packageForPrint (
    to = targetFolder,
    copyingFonts = false,
    copyingLinkedGraphics = true,
    copyingProfiles = true,
    updatingGraphics = true,
    includingHiddenLayers = true,
    ignorePreflightErrors = true, // (Si false et qu'il y a des erreurs preflight, le script ne fait rien.)
    creatingReport = false,
    includeIdml = false,
    includePdf = true,
    forceSave = true
)
 
}

}

///// what wrong ?

TOPICS
Scripting

Views

88

Likes

Translate

Translate

Report

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

correct answers 1 Correct Answer

Valorous Hero , Jan 20, 2021 Jan 20, 2021
Dear Americo,What puzzles me right now is that how you are setting your parameters for the function call :doc.packageForPrint ( to = targetFolder, copyingFonts = false, copyingLinkedGraphics = true, copyingProfiles = true, updatingGraphics = true, includingHiddenLayers = true, ignorePreflightErrors = true, // (Si false et qu'il y a des erreurs preflight, le script ne fait rien.) creatingReport = false, includeIdml = false, includePdf = true, forceSave = true ) I would stick to something more abo...

Likes

Translate

Translate
Adobe Community Professional ,
Jan 20, 2021 Jan 20, 2021

Copy link to clipboard

Copied

Hi,

 

I have not run your code but I can't see anything that would cause the issue, unless your arguments are not coming in the way you expect and therefore your output path is not correct? or there has been a change to where you can save? I have not used CEP so can't provide much guindance there.

 

Malcolm

Likes

Translate

Translate

Report

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
Valorous Hero ,
Jan 20, 2021 Jan 20, 2021

Copy link to clipboard

Copied

LATEST

Dear Americo,

What puzzles me right now is that how you are setting your parameters for the function call :

doc.packageForPrint (
to = targetFolder,
copyingFonts = false,
copyingLinkedGraphics = true,
copyingProfiles = true,
updatingGraphics = true,
includingHiddenLayers = true,
ignorePreflightErrors = true, // (Si false et qu'il y a des erreurs preflight, le script ne fait rien.)
creatingReport = false,
includeIdml = false,
includePdf = true,
forceSave = true
)

 

I would stick to something more about :

doc.packageForPrint (

targetFolder,
false,
true,
true,
true,
true,
true, // (Si false et qu'il y a des erreurs preflight, le script ne fait rien.)
false,
false,
true,
true
)

 

Maybe assigning values inside function call is somehow permitted but I have some doubts here. It's likely the error (if any) wans't thrown through the CEP layered cake.

Likes

Translate

Translate

Report

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