file-type-defaults

Set default macOS applications for file extensions and UTIs using utiluti.

Updated Dec 4, 2014
One-click install
npx skills add https://github.com/kevintraver/dotfiles --skill file-type-defaults
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: file-type-defaults
Source: https://github.com/kevintraver/dotfiles/tree/main/agent-skills/file-type-defaults
Command: npx skills add https://github.com/kevintraver/dotfiles --skill file-type-defaults

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you set default applications for file types on macOS using the utiluti command-line tool, streamlining file-type associations across the system.

Core Features & Use Cases

  • File-based method: Set defaults by using a sample file to determine type associations.
  • UTI-based method: Retrieve UTIs for extensions and assign apps accordingly.
  • Finding bundle IDs: Use osascript to obtain application bundle IDs for accurate targeting.

Quick Start

utiluti file set /path/to/existing/file.<extension> <bundle-id>

Or create a sample file and use:

touch /tmp/sample.<extension> utiluti file set /tmp/sample.<extension> <bundle-id>

Frequently Asked Questions about file-type-defaults

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set default applications for file types on macOS?

Set default applications for file types on macOS using the utiliti command-line tool with either a sample file or UTI method. Use `utiliti file set /path/to/file.<extension> <bundle-id>` to assign an app to a file extension, or retrieve the UTI for more precise control over type associations.

What is a UTI and when should I use it instead of file extensions?

A UTI (Uniform Type Identifier) is macOS's system for identifying file types beyond extensions. Use UTI-based assignment when extensions alone don't capture the full type, when handling dynamic types, or when you need more granular control over which applications can open specific file formats.

How do I find an application's bundle ID to set file-type defaults?

Retrieve an application's bundle ID using osascript, which queries the system for accurate identifiers needed to assign file-type handlers. The Skill uses osascript to automate this lookup, ensuring you target the correct app when configuring file associations.

Can I automate setting file-type defaults across multiple extensions?

Yes, you can automate file-type association configuration by scripting multiple utiliti commands for different extensions or UTIs. The Skill handles both file-based and UTI-based methods with verification steps, letting you apply defaults across file types systematically.

What happens if I set a file-type default and it doesn't work?

The Skill includes verification steps to confirm new file associations took effect. If defaults don't apply, check that utiliti is installed, the bundle ID is correct, and the application supports that file type on your macOS version.

Do I need to create sample files to set file-type defaults?

The file-based method works with existing files or sample files you create temporarily. Use `touch /tmp/sample.<extension>` to generate a sample file when you don't have an actual file of that type to reference for setting defaults.