Problems opening saved lister layouts and executing commands

I have two problems, one minor which is only annoying and another one that is really wreaking havoc.

The minor one is that opening saved layout does not work reliably. And this is the cause of the rest of the problems. Down below is a small sequence of commands that should synchronize a folder with a collection of music files.

Go LAYOUT=16A8_MP3_synchro
Select ALL 
Set FOCUS=Left
Select SOURCETODEST 
Set FOCUS=Right
Select INVERT 
Delete QUIET 
Set FOCUS=Left 
Copy WHENEXISTS=skip

It should open the saved layout, remove the files from the folder that are not present in the collection and copy those that are not present in the folder. I assigned it to a button on a toolbar.

Now, the first thing that is worrying that the command "Go LAYOUT=16A8_MP3_synchro" is unpredictable on its own.

I tried the following:

  1. If I issue it from a CLI or it is the only command the button should execute, it does not open anything.
  2. If I click the button with the complete set of commands on a (single or dual panel) lister that is a destination and there are no other listers open, nothing (visible) happens.
  3. If that lone lister is source, a "Select Destination Folder" dialog pops up.
  4. If there are more than one listers open, nothing happens, no matter if the lister is single or dual, source or destination or neither of those.
  5. If the lister layout is already open (or at least the left panel in a dual lister matches that of the saved one) and I click the button in that lister while there are no selected files in the panel that has the focus, nothing happens.
  6. If there is a file selected, it opens a new layout but instead of having it as it was saved, the left panel shows the folder where the selected file is located (instead of the collection), the right panel shows the location it should, that is, the folder to be synchronized. And to be more confusing, it seems that the following commands are issued in the old dual panel lister :unamused:
Select ALL 
Set FOCUS=Left
Select SOURCETODEST 

and these in the new dual panel lister :open_mouth:

Set FOCUS=Right
Select INVERT
Set FOCUS=Left

No file copy or delete actions were executed.

So it's either I do something wrong, or executing commands suffers from some unknown illness. Set FOCUS=Right should change focus in the dual panel lister and not between two listers, by the way.

Does anybody has the slightest idea why did it went to be a total mess? :question:

Are you just using the layout to open two folders in the current window? Go-LAYOUT isn't really for that. Prefs-LAYOUT is used to open layouts, but it'll open a new window which the rest of the commands won't affect, so that's not useful here either.

Instead of a layout use a Go command with the PATH and DUALPATH arguments. (Or two Go commnads, one to load the left path and one the right.)

Something like this (I've rearranged some of the Set FOCUS commands, too) should work, I guess:

Set FOCUS=Left Go PATH "C:\My Source Path" DUALPATH "D:\My Dest Path" Set FOCUS=Left Select ALL Select SOURCETODEST Set FOCUS=Right Select INVERT Delete QUIET Set FOCUS=Left Copy WHENEXISTS=skip

Personally, though, I wouldn't do it like. It might work but I'd be worried about it going wrong it I accidentally clicked somewhere while it was half-way through, changing the side that gets copied or deleted.

I would use the Sync panel instead, but that can't really be automated at the moment (beyond source & destination folders) so if you do this often, and use the sync tool in other ways as well, then it might be a pain to have to keep configuring the sync panel's settings.

[quote="leo"]Are you just using the layout to open two folders in the current window? Go-LAYOUT isn't really for that. Prefs-LAYOUT is used to open layouts, but it'll open a new window which the rest of the commands won't affect, so that's not useful here either.
[/quote]
No, I hoped that it will open two folders in a new dual-panel lister but it did not seem to work. What is Go LAYOUT for then? Prefs LAYOUT behaved just the way you said so it's rather useless in my case.

Yes, I noticed as soon as I posted that Set FOCUS=Left and Select ALL were swapped, thanks.

I would not either. I already use a mirroring application but it (quite obviously) does not recognize collections so I cannot use it here. I'm stuck with this solution. It looked like a good one at the first glance.

I don't mind sitting still/walking away though, until it reaches the copy part but it does not work yet :slight_smile:

I tried Sync panel but it did not work as expected until I realized that I must select DST Compensation to make it function correctly. Besides, I would like the synchronization to happen whenever I lock my workstation and Sync panel does require some user input.

I tried that and it works but I still have problems. There seems to be some timing issues. In the sequence of

Go coll://16A8/Drives/E/Music DUALPATH T:\Music 
Select ALL
Select SOURCETODEST 

Select ALL does not select anything as if the source is not yet loaded and Select SOURCETEDEST pops up the "Select Destination Folder" dialog as if the destination panel is not existing yet. Is there a way to synchronize the function execution? I'm not familiar with @sync modifier and I don't know how it works (if it is applicable at all).

Go LAYOUT changes a lister to look like the first lister saved in a layout, but not necessarily using the path(s) from the layout. It's unlikely to be used since Opus got Styles which are more suitable for that kind of thing.

If you want it to run with no user input at all when your workstation is locked, I'd look at using the RoboCopy command which comes with Windows.

RoboCopy has options to sync one folder to another and delete destination files that are no longer in the source (/PURGE). It's more suited to running fully automated (that's what it's for really).

I know robocopy but since it does not recognize collections (just like the mirroring application I use) it is not a solution. The files in the collection come from arbitrarily chosen locations.

Is there anything I can do to synchronize subcommand execution? If I execute them from a CLI window one after the other the whole sequence works like a charm. If I run them from a button or a command it breaks after the first one as if the second one does not wait the first one to complete and so on.