Advance function

NAME is a /M argument, listed as NAME/M in the manual. /M and similar are described at the start of the Opus Raw Commands chapter in the manual:

So it makes sense that if you give it 4 separate names it'll create 4 folders.

That said, the /O and /K type of arguments appear to take multiple arguments separated by commas and the manual doesn't mention that at all, so I can understand a bit of confusion. I think that, technically, /O and /K only take one argument (the full string after them, including commas) which is split up later at a different level. A subtle difference... Anyway, the important thing to remember is that /M arguments swallow up what comes after them if it isn't recognised as another argument.

As for the = after argument names, this is usually optional but sometimes required. For example, if you run

CreateFolder NAME FROMCLIPBOARD

then you'll get a folder named after the string in the clipboard. If you wanted to create a folder that is literally called "FROMCLIPBOARD" then you'd have to use

CreateFolder NAME=FROMCLIPBOARD

@Nudel I'm relieved to hear you say that section of the manual is a bit confusing. every time I read that section (which is every time I create a new button), I'm left scratching my head trying to comprehend how each type of qualifier differs from the others.

But confusion aside, wouldn't you agree that it is an issue when Opus rearranges the quotes the user types?

There is a big difference between typing this: ARGUMENT="value" and executing this: "ARGUMENT=value".

Duhhhh !!

Here is an answer to the original question of the post.

runmode hide @firstfileonly @nodeselect sync:C:\yourpath\AutoFolder.exe {destpath|noterm} {file$|noext} dopusrt /cmd copy to {destpath}{file$|noext} zip

This results in a folder in the dest named the root of the first selected file or folder.
The content of this folder is a zipfile named the same.
The contents of the zipfile are all selected files and folders.

Wasn't that ' kind of ' the original problem ?

Regards,
Porcupine

And that simplifies to just this:

@firstfileonly @nodeselect dopusrt /cmd copy createfolder {destpath}{file$|noext} zip

Porcupine

@Ken
I've rewritten your Initialize Test Cases batch file as a 4NT batch file.
I saved it as a *.btm 4NT batchfile and ran it from the DOpus button.
In case you're curious, you can download it at the bottom of this post.

OK, my results on Win9x were almost the same as yours.
I had a small problem with Add Selected to Favories Menu.
Both Issue B and Workaround 2 sometimes worked and sometimes didn't.
I haven't been able to find a sequence of events that reproduces the problem every time though.
In any case, a second attempt always cleared the problem and it then worked.

Note that these are syntaxes:
2. dopusrt /CMD Command ARGUMENT="{code value containing spaces}"
5. dopusrt /CMD Command ARGUMENT "{code value containing spaces}"

It should be interesting to try this again with arguments that contain two code values.

Regards,
Porcupine
4NT Initialize Test Cases.zip (1.54 KB)

Thanks for the download, but I don't use 4NT. I don't really have a need, since I can script pretty much anything I need to in a NT Command script. (If I would crack open that Windows Scripting Host book I bought, I could do even more.)

Okay so you are on Windows 98. I'll keep this in mind in the future. I have a whole toolbar that you will not be able to use, unless somehow the scripts can be modified for Win 98. (I don't believe you can use the syntaxes like "Call :label").

Q: So am I clear in understanding that Workaround 1. (syntax 4)and Workaround 3. (syntax 6). both worked correctly on Windows 98 for all three commands?

If so, those are the syntaxes that we should be telling people to use. The more I think about it, it should really be Workaround 6. (which is also what Jon suggested to use).

Q: In the case of Workaround 2. (syntax 5) , can you do the following for me?[ol][li] Empty your %Temp% folder.[/li]
[li] Edit the button and change it to an MS-DOS Command function type.[/li]
[li] Execute the command, such that it does not work.[/li]
[li] Go to the %Temp% folder and find the most recent dop0x.bat file (numbers are hexadecimal).[/li]
[li] open up this file in a text editor and copy-and-paste the batch Opus wrote into a code box here.[/li][/ol]I'd like to see what happened why it didn't work for you.

Hi Ken,

[quote]Q: So am I clear in understanding that Workaround 1. (syntax 4)and Workaround 3. (syntax 6). both worked correctly on Windows 98 for all three commands?
[/quote]
Yes, quite correct.
It was only the Add Selected to Favorites button that I had any trouble at all with any of the workaround solutions.

[quote]If so, those are the syntaxes that we should be telling people to use. The more I think about it, it should really be Workaround 6. (which is also what Jon suggested to use).
[/quote]
Yes, I agree that syntax 6 is the best answer with this set of problems.
As you know, we have only considered arguments that contain one code value.
When Auusieboykie pointed out the problem with path names that contain space characters we were discussing what is now:

@nofilenamequoting dopusrt /cmd CreateFolder Name ""{destpath}{file$|noext}""
This is a two code value problem.
We have yet to discuss these objects.

[quote]Q: In the case of Workaround 2. (syntax 5) , can you do the following for me?

[ul]

  1. Empty your %Temp% folder.
  2. Edit the button and change it to an MS-DOS Command function type.
  3. Execute the command, such that it does not work.
  4. Go to the %Temp% folder and find the most recent dop0x.bat file (numbers are hexadecimal).
  5. Open up this file in a text editor and copy-and-paste the batch Opus wrote into a code box here.
    [/ul][/quote]

I've been trying to do just that.
I've been cranking out example after example that works with little luck now getting it to NOT work.
I did have one instance that didn't work, but it failed to generate a DOS window as well.
I think I did see a brief flash of an animated hourglass, but it did not generate a DOpus bat file for that operation.
Unless I can provide you with a concrete example, I think you're going to have to dismiss it as probable user error.

Regards,
Porcupine

Well,
We have here four buttons.
[ul]

  1. Creates a Folder in the Source named the root of the first selected file or folder.

@firstfileonly dopusrt /cmd CreateFolder {file$|noext}

  1. Creates a Folder in the Dest named the root of the first selected file or folder.

@firstfileonly @nofilenamequoting dopusrt /cmd CreateFolder ""{destpath}{file$|noext}""

  1. Creates a Folder or Zipfile in the Source named the root of the first selected file or folder.
    All selected source files and folders are then copied to the new folder or zipfile.

@firstfileonly @nodeselect dopusrt /cmd copy createfolder {file$|noext} zip here

  1. Creates a Folder or Zipfile in the Dest named the root of the first selected file or folder.
    All selected source files and folders are then copied to the new folder or zipfile.

@firstfileonly @nodeselect dopusrt /cmd copy createfolder {destpath}{file$|noext} zip
[/ul]

Earlier in this thread I used a homemade program called Autofolder .

runmode hide @firstfileonly @nodeselect sync:C:\yourpath\AutoFolder.exe {destpath|noterm} {file$|noext} dopusrt /cmd copy to {destpath}{file$|noext} zip
This worked because Autofolder was an external program.
Sync: delayed the DOpus Copy until Autofolder had created the new folder.
I see no point in attempting to rewrite 3 and 4 as a combination of a DOpus Create Folder and a DOpus Copy command.
A search of this forum will turn up long, long discussions that eventually led to the introduction of the Copy CreateFolder command.

It would be nice to be able to add a readauto to buttons 3 and 4, but it doesn't seem to work.
One could have a second button that does something like this:

dopusrt /cmd Go newtab openindest {destpath}{file$|noext}.zip

... but it's just as easy to double-click the new Folder/Zipfile.

Regards,
Porcupine

Is Copy Createfolder, as distinct from the raw Copy and Createfolder commands, fully documented somewhere?

Regards. AB

Hello Aussieboykie,

[quote]Is Copy Createfolder, as distinct from the raw Copy and Createfolder commands, fully documented somewhere?
[/quote]

Yes and No.
It is noted in the Opus 82 Changes.pdf
It is at page 7/34 or page 7 of 34.
It doesn't say very much though.

It was introduced in DOpus 8.2.0.0
It was a big Woo-Hoo cheer for Jon when it was introduced.
See Steje's post at [url]'Rename' command question]

Thanks much Aussieboykie !
I do think you found a bug.
We shouldn't need @nofilenamequoting for this.

Regards,
Porcupine

If it's in the 8.2 Changes PDF then it should also be in the full manual PDF, since the manual was brought up to date last week:

[Directory Opus 8 manual updated)

If it's missing from the manual then drop GPSoft an email. Greg seems keen to fix manual errors/omissions at the moment.

Thanks Nudel,

I hadn't seen the updated manual yet.
At first glance, I don't see any mention of Copy CreateFolder.

Good idea !
Perhaps Aussieboykie could do the same.
Together, perhaps GPSoft will improve Copy CreateFolder and its documentation.

Regards,
Porcupine

Porc

I experimented with your Copy Createfolder examples (3) and (4). @nodeselect appears to be redundant as no files are left selected whether it is included or excluded. I then added a select reselect statement. It breaks the Copy Createfolder command unless it is expressed in the dopusrt /cmd select reselect format.

In summary, this does not break copy createfolder.

@firstfileonly dopusrt /cmd copy createfolder {file$|noext} zip here dopusrt /cmd select reselect
whereas both of the following prevent copy createfolder from doing its thing.

[code]@firstfileonly
dopusrt /cmd copy createfolder {file$|noext} zip here
select reselect

@firstfileonly
sync:dopusrt /cmd copy createfolder {file$|noext} zip here
select reselect[/code]
Regards, AB

Hello Aussieboykie,
I have the same results.
I'm at a loss to explain why.

Yes, no files are left selected.
Redundant No !
I do not have this result at all !!
Does the original button, with the @nodeselect removed, work for you ?
The button doesn't work at all here without @nodeselect !

Ohh do you mean redundant in that dopusrt /cmd select reselect does better ?
Well, we'll have to see.
Perhaps it's paranoid, but it bothers me that select reselect doesn't work without the pseudodelay of dopusrt /cmd.

Regards,
Porcupine

Porc

[quote="porcupine"]
Does the original button, with the @nodeselect removed, work for you ?
The button doesn't work at all here without @nodeselect ![/quote]
My apologies. I thought I had tested this properly with/without @nodeselect but apparently not. Having said that, this gets more and more weird.

This works (your original version) but leaves no files selected.

@firstfileonly @nodeselect dopusrt /cmd copy createfolder {file$|noext} zip here
This is completely broken - it does not create a zip and leaves the originally selected files unselected.

@firstfileonly dopusrt /cmd copy createfolder {file$|noext} zip here
This does what I expected your original version would do - it creates a zip and retains the original file selection.

@firstfileonly dopusrt /cmd copy createfolder {file$|noext} zip here dopusrt /cmd select reselect
I am (very) confused.

Regards, AB

deleted by myself (amix)

I need apologize because i was away since a long time, very sorry, and as the junary month isn't over, happy new year and good health to every creators/users of Directory Opus !!!!!!!! (^O^)/

There is no need at all to apologize !
To the contrary, we would have never accomplished this without you !
Your contribution to this thread is as important as everyone else's contribution.

Thankyou,
Zippo

It certainly is a lesson on sorting the archive bit isn't it ?
Thankyou again y0y0gigi.

Regards,
Zippo

Anyway, Zippo, Aussieboykie,kenalcock,Nudel thank you very much for all your work is this topic...Hard to follow you, but you succed ! :wink: