Pages: 1
RSS
Tomorrow's date on the subject
 
I'm new to 'The Bat!', and I'd like to know how I can add tomorrow's full date to the subject. That is, if today is Sunday, December 27th, the date Monday, December 28th, should appear in the subject line.
I'm new, so be patient with me.
 
What is subject line?
Модератор. Не являюсь сотрудником RitLabs (I'm not an employee of Ritlabs). https://belrus.biz/vendors/ritlabs.html
 
I meant 'subject field'. I want to prepare a template, so that using %SUBJECT, tomorrow's date will automatically appear in the subject field.

Thanks.
 
I think all date related macro commands in The Bat work with the current date only.
(See https://www.ritlabs.com/en/support/help/73/ for all macro commands)

Maybe you can use a cmd script or some utility in Windows that manipulates the date and stores it in a text file, or in an environment variable, and then somehow retrieve that and use it in the subject field. But how to do that, I'm afraid I cannot tell you.
I volunteer as a moderator to help keep the forum tidy. I do not work for Ritlabs SRL.
 
After much thought, I think I have found a solution.

1. I create a Powershell script to give me tomorrow's date. c:/tomorrow.ps1
    $a = (Get-Date).adddays(1)
    $b = Get-Date $a -DisplayHint Date;
    $b | Out-File -FilePath c:\tomorrow.txt

This way it creates a file with the date in txt.

2. Then I create a batch file (BAT extension) c:/tomorrow.bat
    ECHO OFF
    PowerShell.exe -Command "C:tomorrow.ps1"

3. I create a shortcut of the file tomorrow.bat in C:\Users\<user>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

This way every time you start windows, the file will be updated with the desired date.

4. Then in 'The Bat!', when you create a template, you only have to paste:
%SUBJECT="The text you want - %PUT='c:/tomorrow.txt'"

If anyone can think of an easier way, please comment.
Thanks
Edited: Juan Miguel García Bernal - 01 January 2021 22:33:32
Pages: 1