No internet connection
  1. Home
  2. Support

readPlist - error - '', hexadecimal value 0x10, is an invalid character

readPlist - error - '', hexadecimal value 0x10, is an invalid character

System Information

SoundFlow 5.1.13-preview.1

OS: darwin 21.6.0

ProductName: macOS
ProductVersion: 12.5.1
BuildVersion: 21G83

Steps to Reproduce

let readPlistsFolder = '~/Desktop/plistFiles';
let extFile = ".plist"
const eliminate = [];

function resFullPath(pluginPath, pluginEXT) {

 let pluginsPaths = sf.file
      .directoryGetEntries({ path: pluginPath, isRecursive: true })
      .paths.filter(path => path.endsWith(pluginEXT) && path.split(pluginEXT).length < 3);

 return pluginsPaths.filter(path => !eliminate.some(e => path.includes(e)));

};

function main() {

 log("Start")

 let resPath = resFullPath(readPlistsFolder, extFile);

 for (let i = 0; i < resPath.length; i++) {
      let valuePath = decodeURI(resPath[i]);
      log(valuePath)
      const plist = sf.file.readPList({
           path: valuePath,
      }).pList;
 };

 log("Done")

};

main();

Expected Result

I expect to read the plist

Actual Result

I get a various of errors : ex: ', hexadecimal value 0x10, is an invalid character. Line 12, position 44. (readPlist: Line 25)
System.Xml.XmlException: '', hexadecimal value 0x10, is an invalid character. Line 12, position 44.
at System.Xml.XmlTextReaderImpl.Throw(Exception) + 0x50
at System.Xml.XmlTextReaderImpl.Throw(String, String[]) + 0xd8
at System.Xml.XmlTextReaderImpl.<ParseTextAsync_Surrogate>d__545.MoveNext() + 0x4e7
--- End of stack trace from previous location where exception was thrown ---

Workaround

n/a

Other Notes

Here is the attached folder with the plist files in question., unzip in your desktop before execyte the sript thanks https://www.dropbox.com/s/1tpzfbct9p4ocwu/plistFiles.zip?dl=0


Links

User UID: zeVjM6FHntfwFzm79GRGlipkNSB3

Feedback Key: sffeedback:zeVjM6FHntfwFzm79GRGlipkNSB3:-NGOhZFa_QQVJ3BokdWM

Feedback ZIP

Solved in post #4, click to view
  • 3 replies
  1. Hi Marco,

    Could you narrow this down to which exact plist it can't open? And possibly try to open that plist in Xcode to ensure it's not invalid?

    1. Hi Chris,

      The plists files in question are in the dropbox link above.
      I’ll check those when later.
      If this are not valid plist files what would be the best to skip when this occurs?

      Thanks

      1. You can see how to implement error handling here:

        https://soundflow.org/docs/how-to/custom-commands/error-handling

        Reply1 LikeSolution