Two listers, but which is which?

Two listers, but which is which?

It's been a while, so bear with me...

Two listers, same toolbars on each, and a button that says

go "c:\put your path here"
Set SORTBY=size

The point of this is to put the empty dirs at the top for easy access.

This works fine if the lister that I push the button on is the source, but if it is the dest, then the first part of the button works, (ie, the GO command) but the GETSIZES and sort commands act on the other (ie source) lister. This seems strange, as I would think that all commands acted one way or another, but not both. I thought the answer might lay in the SET command, but I had no succes there, for now anyway. LOL, I am not even sure that this is the best way to achieve this, so I am happy to take advice :slight_smile:


I think its because the GETSIZES and sort commands always act on the source.
You could fix this by enabling the "Click on destinations toolbar only changes state". That way you can only click the button on the source.

Thanks for the quick reply, but I have to say I don't understand this. It works in that with two clicks the button now works, but I can make it work with two clicks without needing to alter a pref or have a button in the new swish file display border toolbar. Maybe I am misunderstanding something? Surely I don't want it to ONLY change state, because it needs to both change state AND swap SOURCE to DEST?

Even so, I don't get why it works ONLY the way it does.

ahh, I found the answer. I just needed to add Set STATE=source

Problem solved :slight_smile:

Opus 1: Gus 0

I guess my main point here was that I found it strange that one command acted one way (ie on the current lister, regardless of its STATE) where the other commands within the same action, acted on ONLY the lister that was in a given STATE, SOURCE being that given state.

I am not saying that this is a bad thing, just that it seems kinda inconsitent.

Anyway, as I said, problem solved.

ta for the idea. I learned some new stuff about that funky new toolbar :slight_smile:

Ah yes Set STATE=source I was trying to find that but couldn't. The option Click on destinations toolbar only changes state sets the destination to the source when the tool bar is clicked on. I have this option enabled as I think it makes sense, others don't like it. Once the destination is swapped to the source your button would have worked. Set STATE=source is a better solution, kudos.

Looking in the help doco:
Go - Navigate to a different folder in the Lister.
GetSizes- Calculate the total sizes of all folders in the current file display.
Set SORTBY=size - Sorts the current file display by the specified column.
Based on that and your findings (I didn't test your button) you are correct it seems a bit inconsistent or at least confusing. Something to consider is that these commands existed before the folder toolbar was created and the buttons then would have been on a toolbar not attached to a file display. So you would have expected the button to always act on the source file display.

Dopus is complex and has evolved over many years, inconsistencies arise from time to time. What we on the forum can do work with what we have to help you achieve what you're trying to do. :slight_smile:

Hey Gus :slight_smile: Cool to see you again!

I think adding Set SOURCE=Focus to the top of the command will make it work:

Set SOURCE=Focus Go "c:\put your path here" GetSizes Set SORTBY=size set SORTREVERSE=On

If you ever want to do the same thing, but opening a new tab, then you can do that using an embedded command (which makes sure the rest of the commands are sent to the new tab instead of the source tab or the tab that was active when the button started running):

Go "c:\put your path here" NEWTAB [ GetSizes Set SORTBY=size set SORTREVERSE=On ]

Hey Leo, ltns :slight_smile:

Thanks for the input.

So much to learn, so little time.

I kinda guessed that the SET command would be the key, but I couldn't understand why the GET SIZES and SORT, didn't work as they imply they do, which is to act on the current lister, rather than a SOURCE/DEST thing. I guess this is a case of the docs not QUITE matching, the command itself, rather than the command not working as intended.

As it happens, the Set SOURCE=Focus is what I tried initially, and when it didn't work, I came here.

Set STATE=source is the key.

I forgot how cool this is. :slight_smile: