Copy link to clipboard
Copied
I am using
app.doScript("Action name", "Set name");
As I said, "isIsolated" is not related to isolation mode. Disregard "isIsolated".
To test if an item or layer is in isolation mode, test if its parent is named "Isolation Mode". The item or layer will have to be targeted by name, because they will lose their index. Example, to test for isolation mode at the level of a layer named "Layer 2":
alert(app.activeDocument.layers[0].layers["Layer 2"].parent.name == "Isolation Mode");
Note that if "Layer 2" is not in isolation mode, you will get an
...What I understand is that by wanting to "select" path1 you want to assign it to a variable called "triangle". path1 is a pathItem not a sublayer. I would do something like this
var lar = app.activeDocument.layers[0];
try {
var layer1 = lar.layers["Layer 2"];
if (layer1.parent.name == "Isolation Mode") {
var triangle = layer1.pathItems[0];
alert(triangle);
}
} catch(e) {
alert(e.message)
}
Copy link to clipboard
Copied
Copy link to clipboard
Copied
app.doScript("Action name", "Set name");
Copy link to clipboard
Copied
I am able to go into Isolation mode.But now if i want to validate it , that if layer is in Isolation Mode or now. How to do that. Because this code is not working
Copy link to clipboard
Copied
Fusion isolée
alert(selection[0].isIsolated)
selection[0].isIsolated = true;
alert(selection[0].isIsolated)
Copy link to clipboard
Copied
As I said, "isIsolated" is not related to isolation mode. Disregard "isIsolated".
To test if an item or layer is in isolation mode, test if its parent is named "Isolation Mode". The item or layer will have to be targeted by name, because they will lose their index. Example, to test for isolation mode at the level of a layer named "Layer 2":
alert(app.activeDocument.layers[0].layers["Layer 2"].parent.name == "Isolation Mode");
Note that if "Layer 2" is not in isolation mode, you will get an error, because "Layer 2" will not be accessible. So you will have to manage errors.
Copy link to clipboard
Copied
Hi femkeblanco
I have a doubt. If i want to select <path1 >. My code is -
var lar = app.activeDocument.layers[0]; //This will select IsolationMode layer
var layer1 = lar.layers[0]; // This will select Layer 1
var traingle = layer1.layers[0]; // This will select sublayer of Layer 1 .
But last line is not working . Please guide me, where i am wrong.
Copy link to clipboard
Copied
What I understand is that by wanting to "select" path1 you want to assign it to a variable called "triangle". path1 is a pathItem not a sublayer. I would do something like this
var lar = app.activeDocument.layers[0];
try {
var layer1 = lar.layers["Layer 2"];
if (layer1.parent.name == "Isolation Mode") {
var triangle = layer1.pathItems[0];
alert(triangle);
}
} catch(e) {
alert(e.message)
}