Page 1 of 1

To extend the "templates" feature

Posted: 18 Jan 2020 21:24
by John_C
Don, don't you mind to slightly extend the "templates" feature? I talk about the templates that are used to copy the files.

Here is the idea:
copy.png
@<yyyy-mm-dd-hh-nn> is the date affix.
#2 is the incremental affix.

Currently, with a great help by Highend, I'm trying to implement it with a script, but there are some issues that can't be resolved on the script level.

Such way of naming is incredibly useful. This is the only one way to have the really logical order of copied and duplicated items.

Re: To extend the "templates" feature

Posted: 18 Jan 2020 21:54
by highend
1.

Code: Select all

aaa.txt@2020-01-16-21-10.txt#2.txt
3 times .txt is just superfluous information

Code: Select all

aaa@2020-01-16-21-10#2.txt
would provide what's necessary as well

So
01. How should XY know what specific format a user needs?
02. Tell me, if a user decides that he wants the affix #3, what names would XY autogenerate?

Re: To extend the "templates" feature

Posted: 18 Jan 2020 22:29
by John_C
> is just superfluous information

At the first glance only. Compare:
order.png
> 01. How should XY know what specific format a user needs?
> 02. Tell me, if a user decides that he wants the affix #3, what names would XY autogenerate?

I don't mean to implement the described idea hard-coded. Instead, it could be easily implemented with the following templates:

incremental affix: *.?#2.?
date affix: *.?@<date yyyy-mm-dd-hh-nn>.?

* should be evaluated to the base name. It already works.
? should be evaluated to the extension. It works in the scripts only, but not in the templates.

A side note, in case Don will accept this wish: The file extension should be considered as the text after the first dot. That is, for aaa.tar.bz2, the extension should be considered as tar.bz2. Otherwise the idea will not work great.

Re: To extend the "templates" feature

Posted: 18 Jan 2020 22:38
by highend
At the first glance only. Compare:
And? I could easily sort them by using custom columns or use the type stats and filter or the extension or primary and secondary sort...

I see no answer to my second question. Your script specifically creates a name before reaching the affix number.
So again, what would XY create when using your template syntax when the affix is #3?
The file extension should be considered as the text after the first dot
And if somebody uses a dot inside the normal naming part before reaching the real extension?

Re: To extend the "templates" feature

Posted: 18 Jan 2020 22:50
by John_C
Sorry, I considered 01 and 02 as the single question.

> 02. Tell me, if a user decides that he wants the affix #3, what names would XY autogenerate?

In such a case the numbering will start with #3. That is:
copy3.png
> And if somebody uses a dot inside the normal naming part before reaching the real extension?

Well, it will be an issue. But there is no single solution.

* Some files have "double extensions" and therefore they should be considered as double. For example, try to rename aaa.tar.bz2. The selected area will be aaa.tar. Is it good? No.
* On the other hand, some people may want to use dots inside file names.

The only way to resolve both these issues is to add the corresponding checkbox.

Edit: I realized just now that "extension after the first dot" sub-idea will not work with the main idea. Well, I could turn the corresponding checkbox off. Files with double extensions will be a kind of problem. I will simply deal with it.