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

saveAs problem

Contributor ,
Jun 29, 2018 Jun 29, 2018

Copy link to clipboard

Copied

Hi,

saving all open documents...

for(n = 0 ; n < app.documents.length ; n++)

{   // setup details:

    file = ...

     opts = new JPEGSaveOptions()

//  app,activeDocument = app.documents;

    app.documents.saveAs(file, opts)

}

Without setting the activeDocument (the commented line), this is just saving the current document several times

TOPICS
Actions and scripting

Views

1.1K

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 , Jun 29, 2018 Jun 29, 2018

There are a few things that just don't work, unless you set the file you want to apply them to as the activeDocument. Looks like this is one of them. It is a big deal just to add a line making the next file active?

Votes

Translate

Translate
Adobe
Community Expert ,
Jun 29, 2018 Jun 29, 2018

Copy link to clipboard

Copied

There are a few things that just don't work, unless you set the file you want to apply them to as the activeDocument. Looks like this is one of them. It is a big deal just to add a line making the next file active?

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 30, 2018 Jun 30, 2018

Copy link to clipboard

Copied

Hi,

it is not a big deal to add the line (once one knows about it), and it could become a habit to add it to multi-document scripts all the time, but it took me a while to figure out what the problem was

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
Advocate ,
Jul 03, 2018 Jul 03, 2018

Copy link to clipboard

Copied

LATEST

I presume it is a typo entering the code in this message, but if it has actually been copied, it is relevant:

//  app,activeDocument = app.documents;

Notice the comma after app … should be a period.

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