diff --git a/ame-log-parser.js b/ame-log-parser.js index a1ed4fe..1631ab4 100644 --- a/ame-log-parser.js +++ b/ame-log-parser.js @@ -1,12 +1,20 @@ /** * AME Log Parser Module * - * Parses Adobe Media Encoder's AMEEncodingLog.txt and AMEEncodingErrorLog.txt - * to extract encoding stats: completion status, encoding time, source/output files, - * presets, codec info, and errors. + * Parses Adobe Media Encoder's encoding logs to extract encoding stats: + * completion status, encoding time, source/output files, presets, codec info, and errors. * - * macOS log path: /Users//Documents/Adobe/Adobe Media Encoder// - * Windows log path: C:\Users\\Documents\Adobe\Adobe Media Encoder\\ + * Log file locations and names vary by platform: + * + * Windows: + * - Path: C:\Users\\Documents\Adobe\Adobe Media Encoder\\ + * - Files: AMEEncodingLog.txt, AMEEncodingErrorLog.txt + * - Encoding: UTF-16 LE with BOM + * + * macOS: + * - Path: /Users//Documents/Adobe/Adobe Media Encoder//logs/ + * - Files: Adobe Media Encoder Log.txt, Adobe Media Encoder Error Log.txt + * - Encoding: UTF-8 (usually) * * AME log format (typical entry): * ──────────────────────────────────── @@ -276,9 +284,20 @@ function readAMELogs(logDir) { if (!logDir || !fs.existsSync(logDir)) return result; - // Find log files - const encodingLogPath = path.join(logDir, 'AMEEncodingLog.txt'); - const errorLogPath = path.join(logDir, 'AMEEncodingErrorLog.txt'); + // Find log files — handle both Windows and macOS naming conventions + // Windows: AMEEncodingLog.txt, AMEEncodingErrorLog.txt + // macOS: Adobe Media Encoder Log.txt, Adobe Media Encoder Error Log.txt + let encodingLogPath = path.join(logDir, 'AMEEncodingLog.txt'); + if (!fs.existsSync(encodingLogPath)) { + // Try macOS naming + encodingLogPath = path.join(logDir, 'Adobe Media Encoder Log.txt'); + } + + let errorLogPath = path.join(logDir, 'AMEEncodingErrorLog.txt'); + if (!fs.existsSync(errorLogPath)) { + // Try macOS naming + errorLogPath = path.join(logDir, 'Adobe Media Encoder Error Log.txt'); + } // Parse encoding log if (fs.existsSync(encodingLogPath)) {