Setting folder colors in a multi command button

Here´s a small problem with a button:

Go coll://USB
select all
clipboard copy .
Go N:
CreateFolder Name "{date|dd'-'MMM'-'yy}"
clipboard paste .

works very well. It copies files to an USB device. But i´d like to have that new folder created using a fat red color style. Wherever i place Properties SETCOLOR=bold, the button won´t work anymore. I´ve tried placing

Go Up
Properties SETCOLOR=bold

after the code, but then nothing happens then. It was the same when placing the Setcolor command after CreateFolder. How can it be done?

Use this:

@set fdate={date|dd'-'MMM'-'yy} Copy FILE="coll://USB\*" TO="N:\" CREATEFOLDER="{$fdate}" Properties FILE="N:\{$fdate}" SETCOLOR="bold"

[quote="leo"]Use this:

@set fdate={date|dd'-'MMM'-'yy} Copy FILE="coll://USB\*" TO="N:" CREATEFOLDER="{$fdate}" Properties FILE="N:\{$fdate}" SETCOLOR="bold"[/quote]

Leo, this is perfect as usual & about a few parsecs more elegant than my approach, although i must admit, that i´ve been a little bit proud of that early steps making more complex buttons. :smiley:

That is one of the fascinating things, there are many ways to accomplish such tasks in Opus.

The button should take the content of a folder with the current date & create a folder with the same name on a drive, copy the contents from the USB folder there & make it bold red. It´s the converse action of the other button, so to say.

@set fdate={date|dd'-'MMM'-'yy}
Go "L:\Webloads" CREATEFOLDER="{$fdate}"
Copy FILE="N:{fdate}*" TO="L:\Webloads{$fdate}"
Properties FILE="L:\Webloads{$fdate}" SETCOLOR="bold"

  • assigning the current date to the "fdate" value
  • create a new folder with fdate
  • copy data from fdate folder to new folder with fdate (?)
  • assigning color

The 3rd line must be wrong somehow. A little debbuger window for such scripts would be nice. Has anyone an idea how to get this to work?

You can't create folders with the Go command. :slight_smile:

Thanks for the hint, now

@set fdate={date|dd'-'MMM'-'yy}
Go "L:_web"
CREATEFOLDER {date|dd'-'MMM'-'yy}
Copy FILE="N:{$fdate}*" TO="L:_web{$fdate}
Properties FILE="L:_web{$fdate}" SETCOLOR="bold

did the trick. The @set command is a very interesting one.

You don't really need the 2nd/3rd lines. You can create the folder as part of the Copy line as in my button.

Also, you should create the folder using {$fdate} instead of a second {date|...} code. In this case it's only important if you run the button just before the date changes but if you ever changed the button to include the time as well then you'd run into problems when the time changed between one line and the other. That's why the @set command was used, to capture a certain date/time and use that for all the other lines.

[quote="leo"]You don't really need the 2nd/3rd lines. You can create the folder as part of the Copy line as in my button.

Also, you should create the folder using {$fdate} instead of a second {date|...} code. In this case it's only important if you run the button just before the date changes but if you ever changed the button to include the time as well then you'd run into problems when the time changed between one line and the other. That's why the @set command was used, to capture a certain date/time and use that for all the other lines.[/quote]

hmm, it´t works now..

.. CREATEFOLDER "{$fdate}"
Copy FILE="N:{$fdate}*" TO="L:_web{$fdate}" ..

i thought i tried that a while ago & there was a "not found" error message, maybe forgot some ""s"?

Actually the "perfect" button for that task would be, if it first would look for some "bold red" folder colors, set them back to a defined standard color, & then would do the "@Set" code. So the most current folder - & only it - would always appear in bold red style. That´s the idea.

It is, of course playing around, cause a simple date sort would basically do the same (having the current folder on top/highlighted). Not to mention the "age" column.