I am trying to add the current date/time stamp to a filename using the variables. I only seem to be able to add the date.
thanks,
Kevin
add date/time stamp to file name
Re: add date/time stamp to file name
Look at my example below
Save the text of the task to a file and use menu Task->Import to import the task into RoboTask.
Code: Select all
;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1251730006
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task182"
Hide=INTEGER|0
ID=INTEGER|-1820018450
LogOnAsUser=INTEGER|1
Name=STRING|"date stamp into filename"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0
[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
[Actions\Action1]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""OLDNAME"" with value ""c:\myfolder\FileName.txt """
Params=FOLDER
[Actions\Action1\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"OLDNAME"
varvalue=STRING|"c:\myfolder\FileName.txt "
[Actions\Action2]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""NEWNAME"" with value ""{ExtractFilePath({oldname})}\{ExtractFileNameNoExt({oldname})}-{DateTimeToFormat({Date},yyyy-mm-dd)}.{ExtractFileExt({oldname})}"""
Params=FOLDER
[Actions\Action2\Params]
expand=STRING|"1"
varname=STRING|"NEWNAME"
varvalue=STRING|"{ExtractFilePath({oldname})}\{ExtractFileNameNoExt({oldname})}-{DateTimeToFormat({Date},yyyy-mm-dd)}.{ExtractFileExt({oldname})}"
[Actions\Action3]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""Old name: {OldName}"""
Params=FOLDER
[Actions\Action3\Params]
icon=STRING|"1"
msg0=STRING|"Old name: {OldName}"
msg1=STRING|"New name: {NewName}"
msgcount=STRING|"2"
playsound=STRING|"0"
showmessage=STRING|"1"
Oleg Yershov
Re: add date/time stamp to file name
Thanks for info! 
