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

How to check if a pathitems object exists in an open document?

Engaged ,
Jun 11, 2023 Jun 11, 2023

Copy link to clipboard

Copied

Hi all. 
I want to know how to check the presence
of a pathitems object in an open
document?
try like this:
-- if(activeDoc.subPathItems.length != undefined){
return:
-- undefined is not an object ....

 

TOPICS
Actions and scripting

Views

137

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 11, 2023 Jun 11, 2023

@AnyON 

 

Something like this?

 

if(activeDocument.pathItems.length > 0){
    alert("A path exists");
} else {
    alert("No paths exist");
}

 

activeDocument - not activeDoc

 

Votes

Translate

Translate
Adobe
Community Expert ,
Jun 11, 2023 Jun 11, 2023

Copy link to clipboard

Copied

LATEST

@AnyON 

 

Something like this?

 

if(activeDocument.pathItems.length > 0){
    alert("A path exists");
} else {
    alert("No paths exist");
}

 

activeDocument - not activeDoc

 

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