Skip to content

Add validation for dynamic UTI registration - #65

Open
jsvk wants to merge 2 commits into
moretension:masterfrom
jsvk:handle-missing-uti
Open

Add validation for dynamic UTI registration#65
jsvk wants to merge 2 commits into
moretension:masterfrom
jsvk:handle-missing-uti

Conversation

@jsvk

@jsvk jsvk commented Jul 27, 2026

Copy link
Copy Markdown

When the OS can't find a UTI for the extension, it returns a dynamic UTI in the format dyn.<random_string>. Example:

% duti -s `osascript -e 'id of app "Visual Studio Code"'` ".info" all
failed to set com.microsoft.VSCode as handler for dyn.ah62d4qmxhk2x44psq31u (error -50)

this PR gracefully handles this situation and returns an error message:

% ./duti -s `osascript -e 'id of app "Visual Studio Code"'` ".info" all
no registered UTI for type "info" (resolved to dynamic UTI dyn.ah62d4qmxhk2x44psq31u); cannot set handler

The exit code is still 2.

I've also updated aclocal.m4 so that it can build on my current version of macOS (Tahoe)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant