0
Engaged
,
/t5/illustrator-discussions/skip-hidden-locked-and-objects-from-hidden-and-locked-layers/td-p/15004361
Nov 26, 2024
Nov 26, 2024
Copy link to clipboard
Copied
When processing objects that were retrieved as 'doc.pathItems' I skip the ones that are
- hidden
- locked
- are on a hidden layer
- are on a locked layer
However, the script still tries to process an object that is on a hidden layer, and gives an error when it does a
item.selected = true; // inside of pasteSubtractOn()
- hidden
- locked
- are on a hidden layer
- are on a locked layer
However, the script still tries to process an object that is on a hidden layer, and gives an error when it does a
item.selected = true; // inside of pasteSubtractOn()
if (!item.locked && !item.hidden && !item.layer.locked && !item.layer.hidden){
pasteSubtractOn(item);
}
TOPICS
Scripting
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
2 Correct answers
Participant
,
Nov 26, 2024
Nov 26, 2024
Layers do not have a hidden property, they are visible
https://ai-scripting.docsforadobe.dev/jsobjref/Layer.html#layer-visible
I would wager this is the problem
Community Expert
,
Nov 26, 2024
Nov 26, 2024
A simpler way to achieve this is to examine item.editable.
Explore related tutorials & articles
Participant
,
/t5/illustrator-discussions/skip-hidden-locked-and-objects-from-hidden-and-locked-layers/m-p/15004368#M428136
Nov 26, 2024
Nov 26, 2024
Copy link to clipboard
Copied
Layers do not have a hidden property, they are visible
https://ai-scripting.docsforadobe.dev/jsobjref/Layer.html#layer-visible
I would wager this is the problem
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
LATEST
/t5/illustrator-discussions/skip-hidden-locked-and-objects-from-hidden-and-locked-layers/m-p/15004990#M428184
Nov 26, 2024
Nov 26, 2024
Copy link to clipboard
Copied
A simpler way to achieve this is to examine item.editable.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

