[FIX] macOS GUI silently reports "Process Complete" even when CCExtractor is missing or extraction fails#2297
Conversation
…ctor scripts - Added shebang and defined CCEXTRACTOR variable for clarity. - Implemented checks for the existence of the CCExtractor tool and for input file presence, providing user-friendly error messages. - Improved exit status handling with specific messages for different outcomes of the CCExtractor execution. - Ensured consistent user feedback for process completion and error scenarios.
cfsmp3
left a comment
There was a problem hiding this comment.
Three things before this can go in.
- Handle all dropped files, not just
$1(it's possible to drop more than one). - Fall back to PATH for the binary location. /usr/local/bin/ccextractor is Intel-Homebrew's prefix. On Apple Silicon, Homebrew installs to /opt/homebrew/bin
- The shipped artifacts still contain the old script. End users don't run mac/gui/src/scripts. They install through InstallCCExtractorMacGUI.app, which unpacks a bundled DMG. Both DMGs in the repo still embed CCExtractor.app with the old droplet script.
…g and user feedback - Updated the CCEXTRACTOR variable assignment to dynamically locate the ccextractor tool. - Enhanced input file checks to allow multiple files and provide clearer user messages. - Improved exit status handling with detailed feedback for each processed file, including success, no captions found, and failures. - Ensured consistent user notifications for process completion and errors.
|
@cfsmp3 Thanks for the review, all three points are addressed:
Incidental finding while regenerating those: the old installer DMG ( Screenshots covering all five states (binary not found, no input file, success, extraction failure, and multiple dropped files with a mixed result):
|
|
this revision introduces a new bug. Filenames go into the AppleScript dialog unescaped. Double quotes are legal in macOS filenames, and one breaks out of the string literal. With a file named display dialog "Finished processing 1 file(s).
Failed:
my"movie bad.ts (exit code 4)
Run from the Terminal to see detailed error output." buttons {"OK"} ...That's a syntax error, so osascript fails and the user gets no dialog at all after processing — which is the same class of silent failure this PR set out to fix. It's also an execution vector, since AppleScript has do shell script; low severity for a local droplet, but worth closing. Only the failure and no-captions paths are affected — the all-success path uses a fixed string. Something like this is enough: |
- Added an escape function to properly format messages for display in macOS dialogs. - Updated dialog display logic to use escaped strings, improving the clarity of user notifications.






Summary
The macOS GUI (Platypus droplet,
mac/gui/src/CCExtractor.app, added in #1138) called/usr/local/bin/ccextractor $1and then unconditionally displayed "Process Complete," regardless of whether the binary existed, the run succeeded, or the file had no captions at all.$1was also unquoted, breaking on file paths containing spaces.Changes
CCEXTRACTORvariable for clarity.$1throughout so file paths with spaces no longer break the script.src/lib_ccx/ccx_common_common.h:0→ "Process Complete. Check the source file's folder for the subtitles."10(EXIT_NO_CAPTIONS) → "No captions were found in this file, so no subtitle file was created."In raising this pull request, I confirm the following (please check boxes):
Reason for this PR:
Sanity check:
Repro instructions
Before the fix, the GUI showed "Process Complete" in all three of the following cases, with no indication anything had gone wrong. After the fix, each case shows the correct, distinct message and the script exits with the matching status code:
0, and the app correctly reports "Process Complete." (video attached)Screen.Recording.2026-07-24.at.4.20.53.AM.mp4
10(EXIT_NO_CAPTIONS); the app now reports "No captions were found in this file, so no subtitle file was created" instead of falsely reporting success. (video attached)Screen.Recording.2026-07-24.at.4.20.39.AM.mp4
CCEXTRACTORat a bad/missing path (or by triggering a genuine extraction failure); the app now reports "CCExtractor failed (exit code $status)..." instead of "Process Complete." (video attached)Screen.Recording.2026-07-24.at.4.19.08.AM.mp4
Closes #2296