0

As a follow up to this answer, I was able to select the innermost group via a script on Illustrator, but I'd like to enable the isolation mode for that group too. So that I don't have to double-ckick on all the hierarchy of parent groups to get to the one I want to "isolate".

In the the Adobe Illustrator CC 2017 Reference (JavaScript) they mention the property isIsolated but I can't enable the isolation mode by setting the property to true.

What is the isIsolated property supposed to do?

Can it be used to enable the isolation mode for some particular group?

This is the script to make the parent group isolated.

if ( app.documents.length > 0 ) {
    var doc = app.activeDocument;

    if ( typeof doc.selection[0] !== 'undefined') {
        var parent = doc.selection[0].parent;

        if ( parent !== doc.selection[0] && typeof parent.layer !== 'undefined') {
            parent.isIsolated = true;
            alert(parent.isIsolated)
            //doc.selection = parent;
        }
    }
}
  • According to the doc you linked it should work on layers, groups, etc. Can you add the code you're using to the question? – Luciano Aug 25 '17 at 9:01
  • @Luciano added a snippet of code, thanks for pointing out. – rraallvv Aug 25 '17 at 14:42
1

Generally having a name like is* means that the attribute is meant for checking. So isIsolated would generally be called just isolated if it were meant to be used in a read and write context, like hidden, locked selected.

This is pretty simple to test though, far simpler and faster than to ask random strangers on interweb. So open ExtendScript Toolkit, and Illustrator. Create a new document in illustrator and populate it with a few objects. Then type following in ExtendScript toolkit:

#target illustrator

var obj = app.activeDocument.pathItems[0];
alert(obj.name + "\nIsolated: " + obj.isIsolated);
obj.isIsolated = true;

And asa result i can say: No, isIsolated does not do much anything. In fact it does not even seem to indicate object is in isolation mode.

|improve this answer|||||
  • I made a similar test to yours, also searched the web for someone having a similar issue or some snippet of code handling isolated mode from a script, but couldn't find anything. By the way, do you know of a way to perform a double-click on the current selection from a script? – rraallvv Aug 25 '17 at 14:41
  • You might be able to execute the command i had this all set up for testing but then i had to go and lasercut piece of acryllic. – joojaa Aug 25 '17 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.