The following macro creates a new file with first line .LOG and second line with date and time in the format you have specified in the Regional and Language settings of Windows and then opens the Save As dialog.
If you want to append automatically current date/time to a file with the extension .log on every file load, use following macro specified to be executed on every file load:
If you want a customized date/time format for log files, specify first at Configuration - Directories the Template Directory.
Then open Advanced - Display/Modify Templates, enter the template name, i.e. "Log Date/Time", press F1 to see help for this dialog and use the date/time format specifiers as described in the help to customize the date/time string. Then click button OK to save name and template "text" to template number 0. A file named Uetmplte.dat is created in the directory specified before and now always automatically loaded.
In the 2 macros above replace the command TimeDate by Template 0.
Best regards from an UC/UE/UES for Windows user from Austria
Folks,
I want to run a macro on an existing file and then save it with a file name that includes the current date and time eg: "Order200612211531.csv"
I know TimeDate inserts text into a file body but I want to include the current date and time into the SaveAs command. This is standard DOS stuff and must be a common requirement. Anyone know how to do this in UE? Eg:
Press key F1 when the dialog is open to see help about templates and what this string means.
Remember the number of this template, for example 0 for your first template.
But before you create the template, specify at Advanced - Configuration - Directories the Template Directory for the template file Uetmplte.dat.
After you have created the template, you can insert this special date/time string with "Order" before and ".csv" after with a hot key assigned to the InsertTemplateX command, or with Advanced - Insert Template, or with Advanced - Individual Templates, or via the Template List (View - Views/Lists - Template List), or with a macro.
Here is the macro which inserts temporarily at top of your already modified file the template, cuts it to user clipboard 9 to next save
the file with this string in the file name. ^c is the place holder for the clipboard content as described in help about macro command SaveAs.
The big advantage of using a template instead of macro command TimeDate is that with a template you can define how the date/time string should look like. The TimeDate command inserts full date and time in the format specified in the Regional and Language Settings of Windows of the current user. And it's not a good idea to modify this Windows setting.
Best regards from an UC/UE/UES for Windows user from Austria