How to select a newly created file?

Following code doesn't work for some reason:

COPY "N:\RTFs\RTFVorlage.rtf" HERE
Select NONE
Select DATE=newest

Even when i use Select RTFVorlage.rtf instead Date=newest, the new file won´t be selected.
Also, the SELECT NONE command fails to work in this specific case (usually no problem). What am i doing wrong?

Copy "N:\RTFs\RTFVorlage.rtf" HERE COPYFILETIMES=no
Select DATE=newest DESELECTNOMATCH

Thanks, Leo, works now as it was intended. :bulb: :thumbsup:

There is still a little issue, though. The file gets selected, but the rename focus still remains on the
initial item, so when i hit F2, the other file is selected:

I noticed that before, but forgot to mention it.

Try adding MAKEVISIBLE, I think it fixes that:

Copy "N:\RTFs\RTFVorlage.rtf" HERE COPYFILETIMES=no
Select DATE=newest DESELECTNOMATCH MAKEVISIBLE

Oh, yes indeed. Now it´s perfectly perfect. I would never had thought of that parameter. :sunglasses:

Yeah, the last part wasn't obvious since it's a side effect of how the item is made visible and not explicitly mentioned in the docs. Seems to work, though.

It won't put the focus on an item which is already selected, so in some cases a Select NONE might be needed first, but not in this case where a new file is always created. (Not sure what happns if you turn on the option to auto-select copied files; it might be needed then.)

Good to know, if i modify this command. At the moment it is copying a template RTF with my favoured font already set (arial), so i dont´t have to use that serif standard font. Anyway, i had to remember, that a focus & a selection is not necessarily the same thing, because obviously we can have 10 items selected, but only one can have the focus, which also can be a file that isn´t highlighted at all.

If you're doing this just be able to specify a new name for the template file - why not just handle that during the copy with the AS argument?

Copy "N:\RTFs\RTFVorlage.rtf" HERE AS

Yes, steje, you're abolutely right. I've changed my button now to use a combination of both codes:

Copy COPYFILETIMES=no "N:\RTFs\RTFVorlage.rtf" HERE AS Select DATE=newest DESELECTNOMATCH MAKEVISIBLE

:sunglasses:

Ah right, I get it... then the file is still sure to be selected so you can just hit enter to open it in your editor or whatever.

[quote="leo"]Yeah, the last part wasn't obvious since it's a side effect of how the item is made visible and not explicitly mentioned in the docs. Seems to work, though.

It won't put the focus on an item which is already selected, so in some cases a Select NONE might be needed first, but not in this case where a new file is always created. (Not sure what happns if you turn on the option to auto-select copied files; it might be needed then.)[/quote]
This had me stumped for a while. I found this thread and thus the answer by luck.
Could the doco be updated?
Better yet could a new argument called SetFocus be added, even if it did the same as MAKEVISIBLE. I would not assume that MAKEVISIBLE would set the focus, I would assume that setting the focus would make it visible. Currently this is very difficult functionality to find.