Skip to main content

Sets default file and URL scheme handlers on macOS 12.0+

Project description

Set default handlers for files and URL schemes on MacOS 12.0+.

Why?

Most existing tools use LSSetDefaultRoleHandlerForContentType and LSSetDefaultHandlerForURLScheme, which are deprecated and apparently only available up to macOS 12.0. dooti uses a different API and should work on Monterey (12.0) and above.

Limitations

  • This tool was built out of necessity for myself and is not battle-tested.

  • The CLI interface is very spartan currently, including not being very talkative and not catching exceptions.

  • The designated handler has to be installed before running the command for this to work at all.

  • Setting some URL scheme handlers (especially for http) might cause a prompt.

  • Setting some file extension handlers might be restricted (especially html seems to fail silently).

Installation

I recommend installing with pipx, although pip will work fine as well:

pipx install dooti

Quickstart

dooti currently supports three commands:

ext

specify handlers for file extensions (will be automapped to associated UTI)

scheme

specify handlers for URL schemes

uti

specify handlers for specific UTI

The first argument is always the target file extension / URL scheme / UTI. This allows you to inspect the current handlers for the specific target:

$ dooti ext html
/Applications/Firefox.app
$ dooti scheme http
/Applications/Firefox.app
$ dooti uti public.html
/Applications/Firefox.app

When you want to change a setting, you need to specify the second argument, which is the default handler to set. The following three formats are supported:

  • name of application:

    dooti ext csv "Sublime Text"
  • absolute filesystem path:

    dooti scheme http "/Applications/Firefox.app"
  • bundle ID

    dooti uti py com.sublimetext.4

Similar tools

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dooti-0.0.1.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

dooti-0.0.1-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file dooti-0.0.1.tar.gz.

File metadata

  • Download URL: dooti-0.0.1.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.10.1 Darwin/21.1.0

File hashes

Hashes for dooti-0.0.1.tar.gz
Algorithm Hash digest
SHA256 fe48482736796c550625a4af5e23c5d44147fa6378650f137ae35cde252a2b8f
MD5 f352d429e2680bfb545791fb3f01dd07
BLAKE2b-256 021422574d52759379f51b1bd89828d95555b48b63d1b305b20c91f35e9ae7ab

See more details on using hashes here.

File details

Details for the file dooti-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: dooti-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 17.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.10.1 Darwin/21.1.0

File hashes

Hashes for dooti-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9fead584a8ff86c78eba040d17a1650f295026e76369c0b359e693906fa85c8d
MD5 0469b4d368cb7794d11e69de591d6b62
BLAKE2b-256 d34b7e7d53cf2788de8575cae3cab059135b94cdc31498dfe0a05dc4b6ca3c48

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page