# Determining item selection status in a standalone viewer?

**URL:** https://resource.dopus.com/t/determining-item-selection-status-in-a-standalone-viewer/27850
**Category:** Help & Support
**Created:** [January 25, 2018, 1:06am UTC](https://resource.dopus.com/t/determining-item-selection-status-in-a-standalone-viewer/27850 "2018-01-25T01:06:23Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![aussieboykie](https://resource.dopus.com/user_avatar/resource.dopus.com/aussieboykie/32/23729_2.png) [@aussieboykie](https://resource.dopus.com/u/aussieboykie)
#### Post date: [January 25, 2018, 1:06am UTC](https://resource.dopus.com/t/determining-item-selection-status-in-a-standalone-viewer/27850/1 "2018-01-25T01:06:24Z")

</div>

I had hoped to be able to test the selected status of each image in a standalone viewer's collection of Item objects but the sample code returns zero no matter how many of the images are (or were) actually selected. The selected property always returns _ **false** _.

```auto
var vwr = DOpus.viewers.lastactive;
var item_count = 0;
for (var i = 0; i < vwr.files.count; i++) item_count = item_count + vwr.files(i).selected;
```

Is this because the tab from which the viewer was launched may no longer be open? It would still be useful to know if only one item was originally selected.

---

<div class="post-metadata">

### Author: ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)
#### Post date: [January 25, 2018, 2:43am UTC](https://resource.dopus.com/t/determining-item-selection-status-in-a-standalone-viewer/27850/2 "2018-01-25T02:43:00Z")

</div>

You could ask the folder tab which files are selected in it, if it is still open. The viewer object has a reference to the folder tab that launched the viewer, when applicable.

Selection state doesn't make sense or apply to the viewer's list of files (the files it will cycle through when you go to the next/previous image). That list may not (usually will not) be the same as the list of files in the viewer's Marked pane either.
