# Set discontiguous Tree View selections via script

**URL:** <https://forum.inductiveautomation.com/t/set-discontiguous-tree-view-selections-via-script/50848>\
**Category:** Ignition\
**Tags:** ignition80, vision\
**Created:** [September 10, 2021, 5:33pm UTC](https://forum.inductiveautomation.com/t/set-discontiguous-tree-view-selections-via-script/50848 "2021-09-10T17:33:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dan\_Bridgeman](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dan_bridgeman/32/3610_2.png) [@Dan\_Bridgeman](https://forum.inductiveautomation.com/u/Dan_Bridgeman)\
**Post date:** [September 10, 2021, 5:33pm UTC](https://forum.inductiveautomation.com/t/set-discontiguous-tree-view-selections-via-script/50848/1 "2021-09-10T17:33:39Z")

</div>

I have a Vision window with a Tree View that allows multiple discontiguous selections, and I have been unable to set its selections based on the results of a script. It’s easy enough to get all selected paths when the user selects multiple items, but there doesn’t appear to be a setSelectedPaths() method to go with the getSelectedPaths().

I tried getting the underlying TreeSelectionModel and setting the paths there with that object’s setSelectionPaths() method, as suggested in this post: [https://forum.inductiveautomation.com/t/multi-select-in-tree-on-reload/10637/2](https://forum.inductiveautomation.com/t/multi-select-in-tree-on-reload/10637/2). That seemed to work, but I could not figure out a way to get the actual Tree View to recognize the paths and show them as selected.

Is there some other way to set these values?
