Greetings!
I’m trying to export text layer contents as a “.xlsx” file from photoshop.
Since the base of UXP is JS, it is not that hard to make an xlsx object with SheetJS library.
the thing is… I can not write an available xlsx file that Excel can read.
this is the code that I’m trying to
let folder = await fs.getFolder();
if (!folder) return console.log("User canceled folder picker.");
const sessionToken = fs.createSessionToken(folder);
let excelFile = await folder.createFile("tmp.xlsx", {overwrite: true});
const saveFile = await fs.createSessionToken(excelFile);
let wb = XLSX.utils.book_new();
let ws = XLSX.utils.aoa_to_sheet(layerTextList, {sheet: "TextBox"});
XLSX.utils.book_append_sheet(wb, ws, "TextBox");
const content = await XLSX.write(wb, {type: "array", bookType: "xlsx", bookSST: false});
await excelFile.write(content, {append: false, format: formats.binary});
this code generates only garbage file that cannot read
Is there any way that I can write xlsx file?
(file should be xlsx cause text contains ‘,’ and Korean letters)
Many thanks in advance.