function aa()
{
let f = Dir(`${ThisWorkbook.Path}\\*`)
while (f) {
console.log(f)
f = Dir()
}
}
function bb()
{
const s = encodeURIComponent(`"${ThisWorkbook.Path}\\" `)
fetch(`http://localhost/?s=${s}&j=1`).then(r=>r.json()).then(j=>{
for (const i of j.results) {
if (i.type === 'file') {
console.log(i.name)
}
}
})
}
在wps里获取,一般是说在宏里
可以用Dir遍历,不过如果需要遍历子目录,需要递归写法
也可以开启everything里的http服务,然后宏里发个请求,获取文件列表,十分快速好用
创作者俱乐部成员
创作者俱乐部成员