Highlighted

Identify document order

Contributor ,
Oct 06, 2020

Copy link to clipboard

Copied

Hello everyone! How to get the order number of the active document?

Captura de tela 2020-10-07 000306.png

Adobe Community Professional
Correct answer by Manan Joshi | Adobe Community Professional

Try the following

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

-Manan

TOPICS
Actions and scripting

Views

76

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

Identify document order

Contributor ,
Oct 06, 2020

Copy link to clipboard

Copied

Hello everyone! How to get the order number of the active document?

Captura de tela 2020-10-07 000306.png

Adobe Community Professional
Correct answer by Manan Joshi | Adobe Community Professional

Try the following

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

-Manan

TOPICS
Actions and scripting

Views

77

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
Oct 06, 2020 0
Adobe Community Professional ,
Oct 06, 2020

Copy link to clipboard

Copied

Try the following

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

-Manan

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
Reply
Loading...
Oct 06, 2020 1
Contributor ,
Oct 06, 2020

Copy link to clipboard

Copied

Perfect! Thank you Manan Joshi

 

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
Reply
Loading...
Oct 06, 2020 0
Most Valuable Participant ,
Oct 06, 2020

Copy link to clipboard

Copied

var msg = "";
for (var i=0;i<app.documents.length;i++) {
	if(app.documents[i] == app.activeDocument) msg = msg + "Document " + (i +1) + " " + app.documents[i].name + " is Active Document\n";
	else msg = msg + "Document " + (i +1) + " " + app.documents[i].name + "\n";
}
alert(msg); 
JJMack

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
Reply
Loading...
Oct 06, 2020 1