Hi,
Here’s my code:
{
"Name": "Array to txt",
"CreationDate": "2024-4-13",
"Commands": [
{
"Command": "executeScript",
"Target": "var linkArray = [\"Saab\", \"Volvo\", \"BMW\"];\n\nvar dataStr =\n\t'data:text/json;charset=utf-8,' +\n\tlinkArray.join('\\n') + '\\n';\n\nvar dlAnchorElem = document.createElement('a');\ndlAnchorElem.setAttribute('href', dataStr);\ndlAnchorElem.setAttribute('download', 'array.txt');\ndlAnchorElem.click();\n",
"Value": "",
"Description": ""
}
]
}
I’ve been struggling to add an empty line at the end of the exported txt file that should contain my array items, \n or \r doesn’t seem to be doing anything on its own which is strange, but if you try for example:
\naaaa then a new line will be added just fine with “aaaa” on it
is this a bug or am I missing something?
more important, is there a way I can have my items listed with an empty line at the end?
like this:
A
B
C