Situation: you see some folder in a job workspace, like on screenshot below and you want to copy all file names with sizes and mtime data.
Solution: paste the following code into your browser console:
$x('//table[@class="fileList"]/tbody/tr[count(./td)>2]//td[position()<last() and position()!=1]')
.reduce(
(result, current) => {
if (current.className != "fileSize") {
result.push({
name: current.textContent,
info: []
})
} else {
result[result.length - 1].info.push(current.textContent)
}
return result
},
[]
)
.map(a => { return {
name: a.name,
mtime: a.info[0],
size: a.info[1]
}})Result 1: You will get an array of objects representing the files in current folder of workspace:
In order to convert it to plain text representation, append the following to the code snippet above:
.map(a => [a.name, a.mtime, a.size] .join('\t'))
.join('\n')Result 2:





