Need help with this copy button

I want a button that will copy a directory into a new directory. I have tried the following but it does not work properly. Note that FolderA and FolderB represent full path names. If I open a dual lister and set both sides to c: and then click on this button, the new folder is created and opened and that half of the lister is switched to dest. It is correct to this point.

I would expect FolderB to be read into the source lister at this point but it is not, it is read into the dest. The source lister still has c:\ displayed and all of the files in it get selected. Would someone please point out what I am missing?

Go e:\FolderA
CreateFolder NAME READAUTO=yes
Set STATE=Dest
go e:\FolderB
select ALL

Jack

Hi Jack,

I've learned a small lesson already from your post.
I'll get to it later.

First, the answer to your question:
To Fix the problem insert sync:dopusrt /cmd before each line.
Also see the excellent post started by Steje at
Unexpected behaviour with CreateFolder...

The lesson I learned is from the pop up window " Create Folder - Diresctory Opus " generated from
CreateFolder NAME READAUTO=yes includes two checkboxes with, "Read New Folder Automatically" checked.
I'll explain .

After running this command, any new folders I create using a button that simply runs CreateFolder, also Go to the newly created folder .
It was quite distressing until I found that running CreateFolder NAME READAUTO=yes and unchecking "Read New Folder Automatically" restores the normal CreateFolder functioning !

I'm running an old system yet , can anyone verify this?

                                  :opusicon: Porcupine

Thanks for the help. That fixed some of the problem. If I add that in front of all of the commands I listed, it works. But since the point of doing this is to copy files, I needed to add the copy command. When I do this, the copy begins executing before I can create the new folder. The link you provided mentions how to do this with but with a known path. I can't see how to do it where the new folder could have any name. Any ideas on how to prevent the copy from starting until the new folder is created?

Jack

Hey guys... :slight_smile:

Porc, I had the same frustration at first, and realized that my 'regular' CreateFolder button (also bound to the Insert key) just needed to be tweaked to run 'CreateFolder READAUTO=no' so that you don't always have to manually uncheck the 'Read new folder automatically' box...

John, not exactly sure what the difference is between what you're trying to achieve and what was in that post porc referred to... and it actually seems like 'your way' is using 'known' paths... (e:\FolderA etc). Since you didn't put your 'Copy' command in the original button function list, can you show the full functions you've tried now and help me understand exactly how you want it to work and what's wrong so far? It seems like the functions porc used at the end of that post I started should do what you want if my stuff doesn't... perhaps with the added use of a Go SWAP command somewhere in there? Also, notice how porc uses 2 'Set State=Dest' commands...

I didn't have the copy in the original list since I was thinking it would be a simple matter of adding copy to the end. Below is the full list. I am trying to create a new folder in the existing FolderA and copy the contents from the existing FolderB into it. I want to automate this process since I do it almost everyday. So the two paths are known but the new folder name is not. The problem now is that if I run this list, the copy function starts executing before I have entered the name for the new folder. I need some kind of wait command to prevent it from starting until the new folder is created. Any thoughts?

sync:dopusrt /cmd Go FolderA
sync:dopusrt /cmd CreateFolder NAME READAUTO=yes
sync:dopusrt /cmd Set STATE=Dest
sync:dopusrt /cmd go FolderB
sync:dopusrt /cmd select ALL
sync:dopusrt /cmd copy

Jack

Hi Jack !

I understand and know that the copy is executing before the new folder has been made.
I don't know why Steje's works, but it does solve this problem.
Change
sync:dopusrt /cmd CreateFolder NAME READAUTO=yes
to
sync:dopusrt /cmd CreateFolder "{dlgstring|Specify folder-name to create and COPY files to...}" READAUTO .
Enter it exactly as written.
That's the beauty of what Steje discovered !

dlgstring|Specify folder-name to create and COPY files to.. is simply text displayed in the New Folder window above the textfield input.

[quote]
sync:dopusrt /cmd Go FolderA
sync:dopusrt /cmd CreateFolder NAME READAUTO=yes
sync:dopusrt /cmd Set STATE=Dest
sync:dopusrt /cmd go FolderB
sync:dopusrt /cmd select ALL
sync:dopusrt /cmd copy[/quote]
This version works on my system:

sync:dopusrt /cmd Go FolderA
sync:dopusrt /cmd CreateFolder "{dlgstring|Specify folder-name to create and COPY files to...}" READAUTO
sync:dopusrt /cmd Set STATE=Dest
sync:dopusrt /cmd go FolderB
sync:dopusrt /cmd select ALL
sync:dopusrt /cmd copy

Try it !

I was reluctant to reply earlier as I had encountered a longlasting problem when using CreateFolder NAME READAUTO=yes .

Thanks for the reply Steje !

:opusicon: Porcupine

That works great. Thank you. On re-reading the other thread, I see the answer was there all along. When I first read it, I thought it was referring to a fixed location for some reason. Since my location wasn't fixed I thought it didn't apply so I stopped there. Thanks for keeping at it untill I saw the fix. :slight_smile:

Jack

Hey now, sorry I couldn't join in the fun (been back and forth to the hospital... I'm a new Dad :slight_smile: !!!)... but I'm glad it's working out for you.

The functions I use are written the way they are so that I can use the same commands as a keybind to copy or move selected files to a new directory in the current folder where I've selected the files, but also as a Drop Menu Context item so that I can right click on files and drag/drop them to another directory in the Folder Tree where I'd like the new destination folder to be created.

Well, Congrats Steje !
I did a search though all the old Dopus emails I've saved from the old mailing list.
Unless I'm missing something, you're the first to accomplish this.
Perhaps GPSoft could give your new family member a free license ( that's licence for you Oxford folks ).

Thanks for the resolute idea.
I'll work on it.

:opusicon: Porcupine

Well thanks very much porc, much appreciated...

But of course, any gratuitous licensing by GP should be for the 'next' release with 'tabbed lister/browsing' right?

:slight_smile: LOL :slight_smile:

With a special edition 'steje junior toolbar' with all of the functions you and I and JohnZ work on built in :slight_smile:.