Nested items remains hidden

I don't remember if this was the case before. A bit difficult to explain with words alone, that's why a video is better.

If in a folder with nested items, I use a Select command to hide some of them, when using Select NOPATTERN SHOWHIDDEN to show them again, the nested items remain hidden. One needs to press the folder expansion pin several times, to show the hidden items again eventually.

Fixed in the next update.

Sorry but this seems to keep happening in v13.4.4.

Ok, please try 13.4.5.

It works now, thanks!

Sorry @Jon , in v13.4.6, something similar happens. There are items that, after being hidden and then shown, remain hidden. I don't remember if this happened in 13.4.5 (I don't have a copy to test and it seems that it's no longer available for download).
To test (the example is a bit convoluted):

function OnClick(clickData) {
	var cmd = clickData.func.command;
	cmd.ClearFiles();
	var tab = clickData.func.sourcetab;
	cmd.RunCommand('Go "/home"'); //Go to DOpus home dir
	tab.Update();
	cmd.SetFiles(tab.dirs);
	cmd.RunCommand('Go EXPANDBRANCH=script'); //expand all dirs to show nested items
	tab.Update();
	var set_dll = DOpus.Create.StringSet();
	var set_else = DOpus.Create.StringSet();
	var item;
	DOpus.Delay(1000);
	DOpus.Output('total visible items :' + tab.stats.items);
	for (var i = 0; i < tab.files.count; i++) {
		item = tab.files(i);
		if (item.ext === '.dll') { //store only the dll's
			set_dll.insert(item + ''); //try strings only too
			//set_dll.insert(item);
			if (item.nested) { //store parent dir
				set_dll.insert(item.path + ''); //try strings only too
				//set_dll.insert(item.path);
			}
		}
		else { //store all the others items
			set_else.insert(item + ''); //try strings only too
			//set_else.insert(item);
			if (item.nested) {
				set_else.insert(item.path + ''); //try strings only too
				//set_else.insert(item.path);
			}
		}
	
	}
	cmd.SetFiles(set_dll); //show only the dll's first, hide the rest
	DOpus.Output('total items in cmd :' + cmd.filecount);
	cmd.RunCommand('Select FROMSCRIPT=unhide HIDEUNSEL DESELECTNOMATCH');
	cmd.RunCommand('Select FIRST');
	DOpus.Delay(1000);
	tab.update();
	DOpus.Output('total visible items :' + tab.stats.items);
	cmd.SetFiles(set_else); //show the rest, hide the dll's
	DOpus.Output('total items in cmd :' + cmd.filecount);
	cmd.RunCommand('Select FROMSCRIPT=unhide HIDEUNSEL DESELECTNOMATCH');
	cmd.RunCommand('Select FIRST');
	DOpus.Delay(1000);
	tab.update();
	DOpus.Output('total visible items :' + tab.stats.items);
	cmd.RunCommand('Select NOPATTERN SHOWHIDDEN'); //show all hidden items
	tab.update();
	DOpus.Output('total visible items :' + tab.stats.items);
}

Select test.dcf (3.6 KB)

The visible items at the beginning (after the expansion) and the end are not equal, and those hidden are not getting visible easily, unless you refresh the tab.

Thanks.

Try this format:

www.gpsoft.com.au/DScripts/download.asp?new=13.4.5

Thanks, but that redirects me to https://cdn.gpsoft.com.au/files/Opus13/Beta/DOpusInstall-13.4.5.Beta.exe, which doesn't work.

FWIW, thanks to lxp, I was able to test this on 13.4.5, and it also happens, so I must have overlooked it when initially testing.

You can use this kind of URL to get old betas (at least while they're still on the server):

Fixed in 13.4.7.

@Jon thanks. I think there are still some issues with Select (and maybe it's because of FROMSCRIPT=unhide). A quick test ready to use:

function OnClick(clickData) {
	DOpus.ClearOutput();
	var cmd = clickData.func.command;
	cmd.ClearFiles();
	var tab = clickData.func.sourcetab;
	cmd.RunCommand('Go "/home"'); //Go to DOpus home dir
	tab.Update();
	cmd.SetFiles(tab.dirs);
	cmd.RunCommand('Go EXPANDBRANCH=script'); //expand all dirs to show nested items
	tab.Update();
	var set_exe = DOpus.Create.StringSet();
	var set_else = DOpus.Create.StringSet();
	var item;
	DOpus.Delay(1000);
	DOpus.Output('total visible items          :' + tab.stats.items);
	for (var i = 0; i < tab.files.count; i++) {
		item = tab.files(i);
		if (item.ext === '.exe') { //store only the exe's
			set_exe.insert(item + ''); //try strings only too
			if (item.nested)  //store parent dir
				set_exe.insert(item.path + ''); //try strings only too
		}
		else { //store all the others items
			set_else.insert(item + ''); //try strings only too
			if (item.nested) 
				set_else.insert(item.path + ''); //try strings only too
		}	
	}
	cmd.SetFiles(set_exe); //show only the exe's first, hide the rest
	DOpus.Output('EXE: total items in cmd      :' + cmd.filecount);
	cmd.RunCommand('Select FROMSCRIPT=unhide HIDEUNSEL DESELECTNOMATCH');
	cmd.RunCommand('Select FIRST');
	DOpus.Delay(1500);
	tab.update();
	DOpus.Output('EXE: total visible items     :' + tab.stats.items);
	cmd.SetFiles(set_else); //show the rest, hide the exe's
	DOpus.Output('NON EXE: total items in cmd  :' + cmd.filecount);
	cmd.RunCommand('Select FROMSCRIPT=unhide HIDEUNSEL DESELECTNOMATCH');
	cmd.RunCommand('Select FIRST');
	DOpus.Delay(1500);
	tab.update();
	DOpus.Output('NON EXE: total visible items :' + tab.stats.items);
	DOpus.Output('NON EXE: total hidden items  :' + tab.hidden.count);
}

Select test.dcf (3.4 KB)

In the end, only the exes should remain hidden (about 7 files in my case), but there are 40.

Do you think you could maybe report all of these at the same time? :smiley:

Sorry :sweat_smile:, in my defense, the issue is kind of the same from the very first post.
Last one I found (or report), I promise. This one is related with grouped flatview, Select FROMSCRIPT=unhide is not used

function OnClick(clickData) {
	DOpus.ClearOutput();
	var cmd = clickData.func.command;
	cmd.ClearFiles();
	var tab = clickData.func.sourcetab;
	cmd.RunCommand('Go "/home"'); //Go to DOpus home dir
	cmd.RunCommand('Set FLATVIEW=On,Grouped'); //flat view grouped
	tab.Update();
	var set_exe = DOpus.Create.StringSet();
	DOpus.Delay(1000);
	DOpus.Output('total visible items :' + tab.stats.items);
	DOpus.Output('total hidden items  :' + tab.hidden.count);
	for (var i = 0; i < tab.files.count; i++) {
		item = tab.files(i);
		if (item.ext === '.exe') { //store only the exe's
			set_exe.insert(item + ''); //try strings only too
			if (item.path.def_value != tab.path.def_value)  //store parent dir
				set_exe.insert(item.path + ''); //try strings only too
		}	
	}
	cmd.SetFiles(set_exe); //show only the exe's first, hide the rest
	DOpus.Output('total items in cmd  :' + cmd.filecount);
	cmd.RunCommand('Select FROMSCRIPT HIDEUNSEL DESELECTNOMATCH');
	cmd.RunCommand('Select FIRST');
	DOpus.Delay(1500);
	cmd.RunCommand('Select NOPATTERN SHOWHIDDEN'); //show all the hidden items
	DOpus.Delay(500);
	tab.update();
	DOpus.Output('total visible items :' + tab.stats.items);
	DOpus.Output('total hidden items  :' + tab.hidden.count);
}
As XML
<?xml version="1.0"?>
<button backcol="none" display="icon" label_pos="right" textcol="none">
	<label>Select test</label>
	<icon1>#newcommand</icon1>
	<function type="script">
		<instruction>@script JScript</instruction>
		<instruction>function OnClick(clickData) {</instruction>
		<instruction>	DOpus.ClearOutput();</instruction>
		<instruction>	var cmd = clickData.func.command;</instruction>
		<instruction>	cmd.ClearFiles();</instruction>
		<instruction>	var tab = clickData.func.sourcetab;</instruction>
		<instruction>	cmd.RunCommand(&apos;Go &quot;/home&quot;&apos;); //Go to DOpus home dir</instruction>
		<instruction>	cmd.RunCommand(&apos;Set FLATVIEW=On,Grouped&apos;); //flat view grouped</instruction>
		<instruction>	tab.Update();</instruction>
		<instruction>	var set_exe = DOpus.Create.StringSet();</instruction>
		<instruction>	DOpus.Delay(1000);</instruction>
		<instruction>	DOpus.Output(&apos;total visible items :&apos; + tab.stats.items);</instruction>
		<instruction>	DOpus.Output(&apos;total hidden items  :&apos; + tab.hidden.count);</instruction>
		<instruction>	for (var i = 0; i &lt; tab.files.count; i++) {</instruction>
		<instruction>		item = tab.files(i);</instruction>
		<instruction>		if (item.ext === &apos;.exe&apos;) { //store only the exe&apos;s</instruction>
		<instruction>			set_exe.insert(item + &apos;&apos;); //try strings only too</instruction>
		<instruction>			if (item.path.def_value != tab.path.def_value)  //store parent dir</instruction>
		<instruction>				set_exe.insert(item.path + &apos;&apos;); //try strings only too</instruction>
		<instruction>		}	</instruction>
		<instruction>	}</instruction>
		<instruction>	cmd.SetFiles(set_exe); //show only the exe&apos;s first, hide the rest</instruction>
		<instruction>	DOpus.Output(&apos;total items in cmd  :&apos; + cmd.filecount);</instruction>
		<instruction>	cmd.RunCommand(&apos;Select FROMSCRIPT HIDEUNSEL DESELECTNOMATCH&apos;);</instruction>
		<instruction>	cmd.RunCommand(&apos;Select FIRST&apos;);</instruction>
		<instruction>	DOpus.Delay(1500);</instruction>
		<instruction>	cmd.RunCommand(&apos;Select NOPATTERN SHOWHIDDEN&apos;); //show all the hidden items</instruction>
		<instruction>	DOpus.Delay(500);</instruction>
		<instruction>	tab.update();</instruction>
		<instruction>	DOpus.Output(&apos;total visible items :&apos; + tab.stats.items);</instruction>
		<instruction>	DOpus.Output(&apos;total hidden items  :&apos; + tab.hidden.count);</instruction>
		<instruction>}</instruction>
	</function>
</button>

In the end, Select NOPATTERN SHOWHIDDEN is unable to revert hidden state.

Ok I think 13.5.1 should solve this once and for all (fixed in a different way).

Fixed in v13.5.1. Thanks!

1 Like