# How to Set visibility false of item?

**URL:** <https://forums.creativeclouddeveloper.com/t/how-to-set-visibility-false-of-item/1380>\
**Category:** UXP Plugin API\
**Tags:** javascript\
**Created:** [October 30, 2019, 5:04pm UTC](https://forums.creativeclouddeveloper.com/t/how-to-set-visibility-false-of-item/1380 "2019-10-30T17:04:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bisketashwin](https://avatars.discourse-cdn.com/v4/letter/b/b3f665/32.png) [@bisketashwin](https://forums.creativeclouddeveloper.com/u/bisketashwin)\
**Post date:** [October 30, 2019, 5:04pm UTC](https://forums.creativeclouddeveloper.com/t/how-to-set-visibility-false-of-item/1380/1 "2019-10-30T17:04:12Z")

</div>

![04%20PM](https://us1.discourse-cdn.com/flex015/uploads/xdplugins/original/1X/3df8ec368034584046198cdfc5336cedd5e6a678.png)

In the screen shot attached I am trying to make all C1Them A visible false  
and C1Them B visible true

How to achieve this.

I am hitting Edit scope error

```
selection.items.forEach(node => {
    console.log(node);
    node.visible = false; //this works
    node.children.forEach(function (childNode, i) {
        console.log(childNode.visible);
        childNode.visible = false; // this throws errir
    });
});

```

This is what i . see in console

```
Plugin Error: Plugin made a change outside the current edit context
at convertPluginErrorToString (plugins/PluginErrorUtil.js:1:198)
at internalFormatPluginError (plugins/PluginErrorUtil.js:1:1073)
at internalReportPluginError (plugins/PluginErrorUtil.js:1:1180)
at Object.reportPluginError (plugins/PluginErrorUtil.js:1:1612)
at r (plugins/ScenegraphGuard.js:1:550)
at Object.checkChange (plugins/ScenegraphGuard.js:1:1067)
at Object.EventEmitter._emitEvent (third_party/events.js:1:1178)
at Object.EventEmitter.emit (third_party/events.js:1:1668)
at SymbolGroup.Group.notifyChanged (lib/scenegraph/GroupExtension.js:1:1030)
at SymbolInstance.<anonymous> (plugins/ScenegraphWrappers.js:1:8365)
at SymbolInstance.<anonymous> (plugins/ScenegraphWrappers.js:1:2622)
at /Users/ashwin/Library/Application Support/Adobe/Adobe XD/develop/Switch-Them/main.js:19:31
at plugins/WrapperList.js:1:378
at LinkedList.forEach (lib/LinkedList.js:1:1534)
at ReadOnlyList.forEach (lib/ReadOnlyList.js:1:282)
at WrapperList.forEach (plugins/WrapperList.js:1:354)
at selection.items.forEach.node (/Users/ashwin/Library/Application Support/Adobe/Adobe XD/develop/Switch-Them/main.js:17:23)
at Array.forEach (<anonymous>)
at switchTheme0 (/Users/ashwin/Library/Application Support/Adobe/Adobe XD/develop/Switch-Them/main.js:14:21)
at Object.execScenegraphEdit (plugins/ScenegraphGuard.js:1:4685)
at BaseCommand._invokePluginCommand [as _commandFn] (plugins/PluginLoader.js:1:5471)
at BaseCommand.execute (lib/BaseCommand.js:1:929)
at Object.T [as executePluginCommand] (././js/0.js:73:54360)
at b._uiEntry.panelId._uiEntry.commandId.n.onclick.e (././js/0.js:95:47055)

```

---

<div class="post-metadata">

**Author:** ![stevekwak](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/stevekwak/32/48_2.png) [@stevekwak](https://forums.creativeclouddeveloper.com/u/stevekwak)\
**Post date:** [November 4, 2019, 8:41pm UTC](https://forums.creativeclouddeveloper.com/t/how-to-set-visibility-false-of-item/1380/2 "2019-11-04T20:41:55Z")

</div>

Hi @bisketashwin, Adobe XD has a limited edit scope based on user’s selection. (see [edit context limitation](https://adobexdplatform.com/plugin-docs/reference/core/edit-context.html?h=edit%20context)). This prevents plugins from editing special objects like boolean groups, repeat grids, and others if they are nested more than 1 level further under the selected object.

In order to make this work, you would need to direct users to click into the object they want to run your plugin on.
