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

Ou est l'erreur : app.activeDocument.saveAs(saveFile, saveOptions, true, Extension.LOWERCASE);

New Here ,
Jun 15, 2015 Jun 15, 2015

Copy link to clipboard

Copied

Bonjour,

J'ai un script qui fonctionne sur Mac, je le passe sur PC et là il fait une erreur avec ce message "une erreur générale de photoshop s'est produite. Cette fonction n'est peut être pas disponible dans cette version de photoshop "

Voilà ma fonction :

// Function to save files

function SaveFile(){

   var docRef = app.activeDocument.name;

    saveFile = new File(destinationFolder+"//"+docRef);

//alert(saveFile);

    saveOptions = new JPEGSaveOptions();

    saveOptions.embedColorProfile = true;

    saveOptions.formatOptions = FormatOptions.OPTIMIZEDBASELINE;

    saveOptions.matte = MatteType.NONE;

    saveOptions.quality = 10;

        app.activeDocument.saveAs(saveFile, saveOptions, true, Extension.LOWERCASE);

    app.activeDocument.close(SaveOptions.DONOTSAVECHANGES)

}

Est-ce que quelqu'un peux m'aider ?

Merci

TOPICS
Actions and scripting

Views

525

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

Enthusiast , Jun 16, 2015 Jun 16, 2015

"saveFile" est défini sur la ligne 14

Votes

Translate

Translate
Adobe
Enthusiast ,
Jun 15, 2015 Jun 15, 2015

Copy link to clipboard

Copied

SaveFile();

function SaveFile(destinationFolder){

//Make sure a document is open

if(!documents.length) return;

//Does this have an extension of ".jpg" ?

var docRef = app.activeDocument.name;

//Make sure destinationFolder is defined and passed to the SaveFile function if i isn't save to the desktop

if(destinationFolder == undefined) destinationFolder = Folder.desktop;

//Check that the active document has an extension of 'jpg'

var EXT = decodeURI(activeDocument.name).toLowerCase().match(/[^\.]+$/);

//if there is no 'jpg' extention add it.

if(EXT != 'jpg') docRef += '.jpg';

saveFile = new File(destinationFolder + "/" + docRef);

saveOptions = new JPEGSaveOptions();

saveOptions.embedColorProfile = true;

saveOptions.formatOptions = FormatOptions.OPTIMIZEDBASELINE;

saveOptions.matte = MatteType.NONE;

saveOptions.quality = 10;

app.activeDocument.saveAs (saveFile, saveOptions, true, Extension.LOWERCASE);

app.activeDocument.close (SaveOptions.DONOTSAVECHANGES)

};

Votes

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
New Here ,
Jun 16, 2015 Jun 16, 2015

Copy link to clipboard

Copied

Bonjour,

Merci pour la réponse, cependant cela ne fonctionne toujours pas ! 

Peut-on se connecter en privé pour voir tout le script ?

merci a vous

Votes

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
Enthusiast ,
Jun 16, 2015 Jun 16, 2015

Copy link to clipboard

Copied

Vous pourriez me PM le script.

Survolez mon nom et sélectionnez "message"

Votes

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
Contributor ,
Jun 16, 2015 Jun 16, 2015

Copy link to clipboard

Copied

Bonjour

Ligne 20 du code de Philip Cord :

app.activeDocument.saveAs (saveFile, saveOptions, true, Extension.LOWERCASE); 

changes comme ceci

app.activeDocument.saveAs (new File(saveFile), saveOptions, true, Extension.LOWERCASE); 

Votes

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
Enthusiast ,
Jun 16, 2015 Jun 16, 2015

Copy link to clipboard

Copied

"saveFile" est défini sur la ligne 14

Votes

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
New Here ,
Jun 16, 2015 Jun 16, 2015

Copy link to clipboard

Copied

LATEST

ok, merci beaucoup !!!

Votes

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