How to Rename a file by adding suffix to existing filename in other words how to get the downloaded filename

I am trying to suffix a downloaded file with some data that I want to scrape off from the website 

{
“Command”: “store”,
“Target”: “${ClientTFN} Name ${ClientName} Channel ${Channel} Sub ${Subject} Date ${IssueDate}.pdf”,
“Value”: “FileNameDownload”
},
{
“Command”: “executeScript_Sandbox”,
“Target”: “x=${FileNameDownload}; return x.replace(/\//g, ‘-’);”,
“Value”: “FinalFileName”
},
{
“Command”: “echo”,
“Target”: “${FinalFileName}”,
“Value”: “”
},
{
“Command”: “onDownload”,
“Target”: “${FinalFileName}”,
“Value”: “true”
},
{
“Command”: “click”,
“Target”: “xpath=//*[@id="atoo-pap-atotablepanel-001"]/ato-table/table/tbody/tr[${TableLoopCounter}]/td[2]/ato-table-cell/div/ato-link/a”,
“Value”: “”
},

Currently I am only able to do a full replace but the original filename gets lost , how do I get the original fileName and then suffix.

I saw this post OnDownload File name with variable - #6 by Abhroneel_Chowdhury
tried Xrun but powershell whill need the original filename as well , either ways how do I get that.

The file name of the downloaded file is not yet available. We are looking into it. What you can do already know is to overwrite the file name with one that you set and know. Will this work for you?

The problem is File extension is somehow always getting overwritten with .txt extension , I won’t know the file extension until I download it , is there any way to retain the extension and just change the file name ?

Thanks

With the V5.6.5 you can get the name of the downloaded file with ${!LAST_DOWNLOADED_FILE_NAME}

Hi Thanks for the update,

Please can I get an estimated release date for that version

thanks

Available for Firefox already, for Chrome it can take a few more days or weeks - Chrome store reviews are very slow currently.