GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Close all listers except source and destination

I made function to close all listers except source, but I want to made option to close all listers except source and destination (in single lister mode). Is this possible?

Close ALLOTHERLISTERS will do that.

But this close my destination lister too. I'm using single listers, not dual.

You'd probably need a script in that case.

Making that script is too difficult for me now. Maybe you can help me or other user. Of course it has low priority for me, but very often will be useful. Thank you for your answer.

Few days and I'll probably get my new, fresh license for O12. :slight_smile:

BTW. FTP update still works strange (Jobs bar appears only on new listers). I waiting for 12.2.3. :slight_smile:

My mistake. I misinterpreted what was said in the first post.

If you buy a licence and link your account, Jon or I will write the script for you. Free evaluation support only goes so far, and not usually into writing custom code (although we do sometimes).

Fair enough. So probably we'll continue this after few days / week.

Ok, account linked (this money bank transfer was faster than I expect). I hope my other questions now have higher priority too :slight_smile: (DO12 - And FTP issue). It's really great software, but always may be better and improved. :slight_smile:

Here's the script/button ready for dragging to a toolbar:

Close all except source_dest.dcf (5.52 KB)

For reference, the JScript code which is in the .dcf so you & others can see what it does without having to download and edit the file:

[code]function OnClick(clickData)
{
var funcListerId = clickData.func.sourcetab.lister + 0; // Coerce to numeric ID.
var cmd = clickData.func.command;
cmd.deselect = false; // Prevent automatic deselection.
cmd.ClearFiles(); // Ignore file/folder selection.

for(var eListers = new Enumerator(DOpus.listers); !eListers.atEnd(); eListers.moveNext())
{
	var lister = eListers.item();
	if ((lister+0) == funcListerId)
		continue; // Assume we never want to close the lister the command launched from.
	cmd.SetSourceTab(lister.activetab);
	// If it's dual-display, assume we want to close it.
	// If it's single-display, check if it's source or dest.
	if (lister.dual == 0)
	{
		if (!cmd.IsSet("STATE=Off"))
			continue; // It's source or dest, so don't close it.
	}
	cmd.RunCommand("Close");
}

}[/code]

Works great - exactly as I want, thank you.

I like the sound of this but unfortunately the button doesn't work for me. I click it and nothing happens!

Nothing wrong here...



I even tried copying the code and creating my own button but...nothing.

Any clues?

(Only differnce I can think of is that I'm using the USB version).

How many dual and single-display windows do you have open when you run it?

Apologies Leo, it works fine. I was thinking tabs, not listers...it's late.