How to read the content of a file from the path: C:\Users\Administrator\Desktop\X.ini using a .PSJS script
Example JSX code, thank you.
#target photoshop
var filePath = "C:\\Users\\Administrator\\Desktop\\X.ini";
var file = new File(filePath);
if (file.exists) {
file.open('r');
var fileContent = file.read();
file.close();
alert("File Content:\n" + fileContent);
} else {
alert("File does not exist: " + filePath);
}
The snippet below should mimic your JSX code. Please note there are some limitations on file system access with UXP so you may have to work around that especially since it looks like you are on Windows (Adobe Docs, MS Docs).