macOS: declare video and audio document types - #684
Open
evilja wants to merge 1 commit into
Open
Conversation
Project::LoadList() already dispatches dropped/opened files by extension into video, audio and subtitle loading, and AegisubApp::MacOpenFiles() routes the macOS `odoc` Apple Event straight into it. The bundle, however, only declares .ass/.ssa/.srt/.txt, so LaunchServices refuses to hand any media file to Aegisub: dragging a video onto the Dock icon is rejected, and Aegisub is greyed out in Finder's "Open With" dialog. Declare the video and audio extension lists from Project::LoadList so the bundle advertises what the application can already load. Both entries use LSHandlerRank "None", as the .txt entry already does, so Aegisub is never proposed as a handler for media files and existing default players are left untouched; the declaration only makes the types droppable. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On macOS, dragging a video file onto the Aegisub Dock icon is rejected — the icon never highlights and the drop bounces back. In Finder's Open With dialog, Aegisub is greyed out for video and audio files; selecting it requires switching the filter to All Applications, and macOS then records it as a per-file binding rather than learning the association, so it has to be repeated for every single file.
Cause
This is purely a missing declaration — the application code already handles these files.
Project::LoadList()dispatches by extension into video, audio and subtitle loading, andAegisubApp::MacOpenFiles()routes the macOSodocApple Event straight into it:So any media path that reaches the app loads correctly — this is the same path used by drag-and-drop onto the Aegisub window, which works today. But
packages/osx_bundle/Contents/Info.plistdeclares only.ass,.ssa,.srtand.txt, and LaunchServices decides drop acceptance fromCFBundleDocumentTypes. Media files are therefore blocked before they ever reachLoadList().Change
Declare the video and audio extension lists from
Project::LoadList(), so the bundle advertises what the application can already load. Subtitle types are untouched.Why
LSHandlerRankNoneNonemeans "never propose this app as a handler for the type" while still allowing the type to be dropped — existing default players (IINA, QuickTime, VLC) are entirely unaffected, and Aegisub does not appear as a suggested handler for anyone's video library. The.txtentry in this file already usesNonefor the same reason.I verified that
Noneis sufficient rather than assuming it, usingLSCanURLAcceptURL(the acceptance check behind Dock drop highlighting), with minimal test bundles on macOS 15.6:.mkvLSHandlerRankNoneLSHandlerRankAlternateAgainst real bundles:
.mkv.mp4.wav.flac.assSubtitle handling is unchanged, and no default handler for any media type is altered.
Notes
.suband.ttxtare also accepted byLoadList()but are deliberately left undeclared here —.subin particular is ambiguous (VobSub vs. MicroDVD) and not reliably loadable, so declaring it would advertise more than Aegisub can deliver. Happy to add them if preferred.🤖 Generated with Claude Code