docs.sheetjs.com/docz/static/extendscript/parse.jsx

22 lines
704 B
React
Raw Permalink Normal View History

2022-05-30 05:04:05 +00:00
#target photoshop
#include "xlsx.extendscript.js";
function main_parse() {
/* Show File Picker */
var thisFile = File.openDialog("Select a spreadsheet");
if(!thisFile) { alert("File not found!"); return; }
/* Read file from disk */
var workbook = XLSX.readFile(thisFile.absoluteURI);
/* Get Workbook Author */
var Props = workbook.Props; if(!Props) { alert("Missing Author!"); return; }
var Author = Props.Author; if(!Author) { alert("Missing Author!"); return; }
/* Change Document Author to Workbook Author */
var info = activeDocument.info;
alert("Changing Author from |" + info.author + "| to |" + Author + "|");
info.author = Author;
}
main_parse();