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

Script Repair After Update

Community Beginner ,
May 02, 2018 May 02, 2018

Copy link to clipboard

Copied

Hey guys, probably a simple question but I'm a simple man using other people's complex tools and I've run into a snag. I just updated my Photoshop to the latest version and the script I previously had been using to save a jpeg version of the file I'm working on has apparently either broken or I just forgot how it's supposed to be used. I used to have it available under the scripts menu and had a keyboard shortcut attached, but now when I go to use it with File>Scripts>Browse it throws a "Error24: saveJPEG is not a function" error and references line 7. Did something get updated and break the script, or am I doing it wrong? Here's the script, which I think I pulled off someone else's thread here in these forums years ago:

//????? ???????????? ??????:

var doc = app.activeDocument;

var docName = doc.name;

docName = docName.match(/(.*)(\.[^\.]+)/) ? docName = docName.match(/(.*)(\.[^\.]+)/):docName = [docName, docName];

var saveName = new File(decodeURI(doc.path)+'/'+docName[1]+'.jpg');

saveJPEG( app.activeDocument, saveName, 10 );

//??????? ??????????:

var doc = app.activeDocument;

var saveOptions = new JPEGSaveOptions();

saveOptions.embedColorProfile = true;

saveOptions.formatOptions = FormatOptions.STANDARDBASELINE;

saveOptions.matte = MatteType.NONE;

saveOptions.quality = 12;

var docName = doc.name.replace(/\.[^\.]+$/, '');

var jpegName = decodeURI(doc.path) + "/" + docName + ".jpg";

var saveName = new File(jpegName);

doc.saveAs(saveName, saveOptions, true, Extension.LOWERCASE);

//????????? ????? ????? ? ??????????? ????

//[0] - ??? ?????? ??? ?????; [1] - ??? ??? ?????; [2] - ??? ?????????? ?????

function GetFileName(objDoc)

{

    var fname = objDoc.name.match(/(.*)(\.[^\.]+)/) ? docName = docName.match(/(.*)(\.[^\.]+)/):docName = [docName, docName];

    return fname;

}

TOPICS
Actions and scripting

Views

354

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

Community Expert , May 02, 2018 May 02, 2018

There are some code is missing:

eg like:

function saveJPEG( d, sFile, qty ) {

{

    //some stuff

    //more stuff

    return;

}

(This is only an example - not working code)

-----------------

Update ? From which version to what?

-----------------

Did you looking for your script also in the correct script folder? For example CC2017 (Windows) in C:\Program Files\Adobe\Adobe Illustrator CC 2017\Presets\de_DE\Skripten

replace (de_DE) with your nation

Votes

Translate

Translate
Adobe
Community Expert ,
May 02, 2018 May 02, 2018

Copy link to clipboard

Copied

Are you sure the script ever worked? Because the function saveJPEG is completely missing in the code (and there are other mistakes).

Sorry

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
Community Beginner ,
May 02, 2018 May 02, 2018

Copy link to clipboard

Copied

You know I wish I could say I was sure, but you have me doubting slightly. I am 95% sure though. I have been using a script for years like I said, and this is the only script I have saved in my files, so I'm almost positive that it was this script I used previously. I have looked through my Appdata>Roaming>Adobe folders and been unable to find any other scripts in there at all, but I'm not certain if updating would have deleted anything I had previously or not.

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
Community Expert ,
May 02, 2018 May 02, 2018

Copy link to clipboard

Copied

There are some code is missing:

eg like:

function saveJPEG( d, sFile, qty ) {

{

    //some stuff

    //more stuff

    return;

}

(This is only an example - not working code)

-----------------

Update ? From which version to what?

-----------------

Did you looking for your script also in the correct script folder? For example CC2017 (Windows) in C:\Program Files\Adobe\Adobe Illustrator CC 2017\Presets\de_DE\Skripten

replace (de_DE) with your nation

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
Community Beginner ,
May 02, 2018 May 02, 2018

Copy link to clipboard

Copied

LATEST

Ah that was it! I was looking in the AppData folder rather than the regular Program Files folder, and you were correct it was a different script that I found under the older version. Thank you for pointing me in the right direction to figure out my mistakes!

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