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

Select only a few documents.

Engaged ,
Oct 26, 2020 Oct 26, 2020

Copy link to clipboard

Copied

Hello friends!
In the workspace I have several documents, however, I need to select and do something only on the documents indicated by a list.
I tried this but was unsuccessful!

var list =[1,4] // target documents
for (var i = documents; i <  list.length; i++){
    var d=Number( list[i]) 
    var doc = documents[d];  activeDocument = doc;  
    alert("something");
}
TOPICS
Actions and scripting

Views

269

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

Guide , Oct 26, 2020 Oct 26, 2020

 

var list =[1,4], // target documents
documents = app.documents;

for (var i=0; i< list.length; i++){
app.activeDocument = documents[list[i]];  
    alert("something");
}

 

* I hope you take into account that the indexing of documents in the collection starts from 0, not from 1

Votes

Translate

Translate
Adobe
Guide ,
Oct 26, 2020 Oct 26, 2020

Copy link to clipboard

Copied

 

var list =[1,4], // target documents
documents = app.documents;

for (var i=0; i< list.length; i++){
app.activeDocument = documents[list[i]];  
    alert("something");
}

 

* I hope you take into account that the indexing of documents in the collection starts from 0, not from 1

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
Engaged ,
Oct 26, 2020 Oct 26, 2020

Copy link to clipboard

Copied

LATEST

Thanks jazz-y perfect, thanks for the quick response!
Thank you!

 

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
People's Champ ,
Oct 26, 2020 Oct 26, 2020

Copy link to clipboard

Copied

var i = documents;
What do you think the "i" became after this line?
 

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
Engaged ,
Oct 26, 2020 Oct 26, 2020

Copy link to clipboard

Copied

r-bin, sorry, I did not understand your question?

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