You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ReadMe.md
+112-4Lines changed: 112 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,11 @@ You can use `utiluti` to inspect and modify default apps for url schemes and fil
8
8
9
9
## Important notes:
10
10
11
-
-`utiluti` should be run as the current user
11
+
-`utiluti` should run as the current user
12
12
13
-
- when you attempt to set the default app for the `http` url scheme, macOS will prompt the user for confirmation. The user has the option to reject the change. The user must make a selection for the tool to continue. Consider this when using `utiluti` for automation.
13
+
- when you attempt to set the default app for the `http` url scheme, macOS will prompt the user for confirmation. The user has the option to reject the change. The user must make a selection for the tool to continue. Consider this when using `utiluti` for automation. (See [macadmins/default-browser](https://github.com/macadmins/default-browser/tree/main) for an alternative)
14
14
15
-
- macOS connects the `http` and `https` url schemes and the `public.html` UTI. You can only set the default app for `http` and the default app for `https` and the `public.html` type will be set to the same app. Attempting to change the default apps for `https` or `public.html` will result in an error.
15
+
- macOS connects the `http` and `https` url schemes and the `public.html` UTI. You can only set the default app for `http`. Then the default app for `https` and the `public.html` type will be set to the same app. Attempting to change the default apps for `https` or `public.html` independently will result in an error.
16
16
17
17
## URL schemes
18
18
@@ -57,7 +57,7 @@ set com.microsoft.Outlook for mailto
57
57
58
58
## File Type/Uniform Type Identifiers (UTI)
59
59
60
-
[Uniform type identifiers](https://developer.apple.com/documentation/uniformtypeidentifiers/) (UTI) are how macOS maps file and mime type. `utiluti` uses UTIs.
60
+
[Uniform type identifiers](https://developer.apple.com/documentation/uniformtypeidentifiers/) (UTI) are how macOS maps file and mime types. `utiluti` uses UTIs.
61
61
62
62
To get the UTI associated with a file extension, use `get-uti`:
63
63
@@ -96,3 +96,111 @@ $ utiluti type set public.plain-text com.barebones.bbedit
96
96
set com.barebones.bbedit for public.plain-text
97
97
```
98
98
99
+
## Getting an App's declarations
100
+
101
+
`utiluti` can list the UTIs and url schemes an app has declared in their Info.plist:
102
+
103
+
List the URL schemes for a given app with `app schemes`:
104
+
105
+
```sh
106
+
$ utiluti app schemes com.apple.safari
107
+
http
108
+
https
109
+
file
110
+
x-safari-https
111
+
```
112
+
113
+
List the UTIs and file extensions for a given app with `app types`
114
+
115
+
```sh
116
+
$ utiluti app types com.apple.TextEdit
117
+
public.rtf
118
+
com.apple.rtfd
119
+
public.html
120
+
com.apple.webarchive
121
+
org.oasis-open.opendocument.text
122
+
org.openxmlformats.wordprocessingml.document
123
+
com.microsoft.word.wordml
124
+
com.microsoft.word.doc
125
+
public.text
126
+
public.plain-text
127
+
com.apple.traditional-mac-plain-text
128
+
public.data
129
+
```
130
+
131
+
Some apps declare file extensions instead of UTIs. In this case `utiluti` will prepend `file extension:`. If there is an associated UTI, it will be shown in parenthesis:
macOS allows for a file to be assigned to an app different from the general default app for that file type. `utiluti` has the `file` verb to inspect or set the default app for a specific file.
176
+
177
+
Get the UTI for a given file:
178
+
179
+
```sh
180
+
$ utiluti file get-uti ReadMe.md
181
+
net.daringfireball.markdown
182
+
```
183
+
184
+
Get the app that will open the file when double-clicked:
0 commit comments