Page 1 of 1

Date & Time Variables for User Menu

Posted: 04 Jun 2013, 17:59
by TimeGhost
It would be handy if we had date and time variables in the User Menu customization.

One implementation might just be to add $[date] and $[time] that would return the current date and time formatted according to regional settings.

Another approach might be to provide a syntax for custom format date / time like this:

$(YYYYMMDD) = 20130604
$(hhmmss) = 115223

The second method is preferred since the separators in the time string tend to include colons, which cannot be used in file names.

One application is when using PDFTK to combine PDF files into one PDF. This command syntax would include a date stamp in the name of the output file:

PDFTK $(ListOfSelectedNames) cat output PDFTK_$(YYYYMMDD).pdf

I apologize in advance if there is an easy way to do this (perhaps using a batch file wrapper), or if this has been requested many times.

Thanks!

Re: Date & Time Variables for User Menu

Posted: 06 Jun 2013, 21:27
by otrov
That perhaps would be handy for your current and particular problem. If AS provides too many variables it would just clutter current easy access

But, AS provides Automation plugin, which can be accessed with various scripting languages.
I find that as the right place for handling any exotic feature, such as datetime and datetime formatting.

Alternatively, as you just wrote, you can call batch (or other) script from the menu and handle it there.

2c

Re: Date & Time Variables for User Menu

Posted: 01 Aug 2014, 13:39
by mdruiter
Try this:

Code: Select all

PDFTK $(ListOfSelectedNames) cat output PDFTK_%DATE:/=%.pdf
Or with time:

Code: Select all

@echo %DATE:/=-% %TIME:~0,2%;%TIME:~3,2%;%TIME:~6,2%> C:\file.txt

Re: Date & Time Variables for User Menu

Posted: 01 Aug 2014, 20:08
by TimeGhost
Thanks! That worked very well! I didn't know I could use environment variables in the F9 command line like that. But in retrospect it makes a lot of sense.