Xtype - Filename with date

Hi!

I`m new at Kantu!
I love to automate the real borring stuff …

So Ive a few macros running now.

For this new macro I`m stuck …
I need to use a dynamic file name, format: ddmm = example: 0411
→ Tomorrow it will be a file named 0511.xls

This is the macro I use now:

{
“Name”: “upload”,
“CreationDate”: “2019-11-4”,
“Commands”: [
{
“Command”: “open”,
“Target”: “http://LINK-HIDDEN/”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “link=Upload File”,
“Value”: “”
},
{
“Command”: “XType”,
“Target”: “P:\LOCATION-HIDDEN\HERE NEEDS TO BE THE DATE ddmm.xls”,
“Value”: “”
},
{
“Command”: “XType”,
“Target”: “${KEY_ENTER}”,
“Value”: “”
},
{
“Command”: “waitForPageToLoad”,
“Target”: “”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “//*[@id="btnUploadOK"]”,
“Value”: “”
}
]
}

How do I dynamic write the date using xtype (or another)

Thanks in advance!

Solved!

ExecuteScript_Sandbox |

var today = new Date(); var dd = today.getDate(); var mm = today.getMonth() + 1; if (dd < 10) { dd = ‘0’ + dd; } if (mm < 10) { mm = ‘0’ + mm; } var today = dd + ‘’ + mm + ‘’; return today;