Is it possible to automatically add the date and time to the file name when saving an image in Siril script?
‘save $DATE:%s$’ simply fails, because “:” is not valid for windows file name.
Thanks in advance.
Is it possible to automatically add the date and time to the file name when saving an image in Siril script?
‘save $DATE:%s$’ simply fails, because “:” is not valid for windows file name.
Thanks in advance.
Hi @solemnify, and welcome!
Why use a colon after date?
Would it work with an underscore,
or a space, or any other delimiter?
Have fun!
Claes in Lund, Sweden
Welcome, yes, the delimiter is a colon character.
Take a look at Path parsing — Siril 1.2.0 documentation where you will find all you need to know.
I have looked through all the documentation related to string parsing, but could not find a way to solve the problem. If you use “save $DATE:%s$.fit” in the example above, it will create “save 2023-03-28T20:09:42.413.fit” from the FITS header. The problem is that there are “:” in the time string part, and I want to replace it with “_”, but I could not find a way to do this in the documentation.
Hi,
no indeed, it can’t be done as implemented as the colon will be passed in the parsed string and this makes the filename non-valid. If you only need the date (not time) you can use a special formatter like $DATE:dm0$
.
If you need both date and time, we could add another special formatter, smthg like $DATE:dt$
, dt
being short for datetime. Would propose it converts to a string YYYY-mm-DD_HH-MM-SS.
Just did it, in fact:
11:00:38: Running command: parse
11:00:38: String in: $DATE:dt$
11:00:38: String out: 2023-03-16_08-50-20
Would that be what you are after?
Cheers,
C.
This is exactly what I was looking for. However, it seems that the dt special formatter is not working. It outputs as follows:
18:06:39: Error code: 7 - Unsupported format: dt - aborting
18:06:39: String in: $DATE:dt$
18:06:39: String out: (NULL)
Sure it does not work yet, I’ve just implemented it on my computer
But if that is what you are after, I guess it will be useful to others so I can push that to the dev version. It can then make its way to the next beta.
I would really appreciate it if you could do that for me. Would it be possible for me to try the patched executable file?
I’ve just pushed the change. In a while (probably less than an hour), you will see a download link at the right of this page: win64-native (#4017870565) · Jobs · FA / Siril · GitLab
Just download the zip, extract it and locate siril.exe. You can launch this portable version to test
Wow!!! Incredible!!! Thanks you!!!