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
+64-22Lines changed: 64 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,43 +15,60 @@ You can use `utiluti` to inspect and modify default apps for url schemes and fil
15
15
16
16
- 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.
17
17
18
+
- many commands require the bundle identifier to specify an app. You can determine an app's bundle identifier with `utiluti` itself, `mdls`, `osascript`/AppleScript, or a GUI tool like [Apparency](https://www.mothersruin.com/software/Apparency/)
URL schemes are the part of the URL before the colon `:` which identify which app or protocol to use. E.g. `http`, `mailto`, `ssh`, etc.
21
38
22
39
Get the current default app for a given url scheme:
23
40
24
-
```sh
41
+
```
25
42
$ utiluti url mailto
26
43
/System/Applications/Mail.app
27
44
```
28
45
29
46
Use the `--bundle-id` flag to receive the app's bundle identifier instead:
30
47
31
-
```sh
48
+
```
32
49
$ utiluti url mailto --bundle-id
33
50
com.apple.mail
34
51
```
35
52
36
53
List all apps registered for a given url scheme:
37
54
38
-
```sh
55
+
```
39
56
$ utiluti url list mailto
40
57
/System/Applications/Mail.app
41
58
/Applications/Microsoft Outlook.app
42
59
```
43
60
44
61
Use the `--bundle-id` flag to receive the apps' bundle identifiers instead:
45
62
46
-
```sh
63
+
```
47
64
$ utiluti url list mailto --bundle-id
48
65
com.apple.mail
49
66
com.microsoft.Outlook
50
67
```
51
68
52
69
Set the default app for a given URL scheme:
53
70
54
-
```sh
71
+
```
55
72
$ utiluti url set mailto com.microsoft.Outlook
56
73
set com.microsoft.Outlook for mailto
57
74
```
@@ -62,21 +79,21 @@ set com.microsoft.Outlook for mailto
62
79
63
80
To get the UTI associated with a file extension, use `get-uti`:
64
81
65
-
```sh
82
+
```
66
83
$ utiluti get-uti txt
67
84
public.plain-text
68
85
```
69
86
70
87
Get the default application for a UTI:
71
88
72
-
```sh
89
+
```
73
90
$ utiluti type public.plain-text
74
91
/System/Applications/TextEdit.app
75
92
```
76
93
77
94
List all applications registered for the given UTI:
78
95
79
-
```sh
96
+
```
80
97
$ utiluti type list public.plain-text
81
98
/System/Applications/TextEdit.app
82
99
/Applications/Numbers.app
@@ -92,18 +109,18 @@ Add the `--bundle-id` flag to receive bundle identifiers instead of paths.
92
109
93
110
Set the the default app for a given UTI:
94
111
95
-
```sh
112
+
```
96
113
$ utiluti type set public.plain-text com.barebones.bbedit
97
114
set com.barebones.bbedit for public.plain-text
98
115
```
99
116
100
-
## Getting an App's declarations
117
+
## Getting an App's declarations and other information
101
118
102
119
`utiluti` can list the UTIs and url schemes an app has declared in their Info.plist:
103
120
104
121
List the URL schemes for a given app with `app schemes`:
105
122
106
-
```sh
123
+
```
107
124
$ utiluti app schemes com.apple.safari
108
125
http
109
126
https
@@ -113,7 +130,7 @@ x-safari-https
113
130
114
131
List the UTIs and file extensions for a given app with `app types`
115
132
116
-
```sh
133
+
```
117
134
$ utiluti app types com.apple.TextEdit
118
135
public.rtf
119
136
com.apple.rtfd
@@ -131,7 +148,7 @@ public.data
131
148
132
149
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:
List paths to applications for a given bundle identifier: (note that the output might have multiple lines, when there are multiple copies of the app, or be empty when there are no apps matching the identifier)
206
+
207
+
```
208
+
$ utiluti app for-id com.apple.notes
209
+
/System/Applications/Notes.app
210
+
```
211
+
212
+
213
+
214
+
215
+
174
216
## Default app for specific files
175
217
176
218
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.
177
219
178
220
Get the UTI for a given file:
179
221
180
-
```sh
222
+
```
181
223
$ utiluti file get-uti ReadMe.md
182
224
net.daringfireball.markdown
183
225
```
184
226
185
227
Get the app that will open the file when double-clicked:
@@ -216,20 +258,20 @@ The file format is an XML Property list. You will need two separate files for as
216
258
217
259
The root object of the property list is a `dict`, each key will be the url scheme or UTI, respectively. The value is the application bundle identifier for the default app that should be set.
218
260
219
-
```sh
261
+
```
220
262
$ utiluti manage --type-file types.plist
221
263
set com.fatcatsoftware.pledpro for com.apple.property-list
set com.fatcatsoftware.pledpro for com.apple.property-list
235
277
set com.barebones.BBEdit for public.plain-text
@@ -278,7 +320,7 @@ Example (UTIs):
278
320
279
321
For managed deployments, the settings can be read from a configuration profile.
280
322
281
-
```sh
323
+
```
282
324
$ utiluti manage
283
325
set com.fatcatsoftware.pledpro for com.apple.property-list
284
326
set com.barebones.BBEdit for public.plain-text
@@ -349,7 +391,7 @@ Example (configuration profile):
349
391
350
392
By default, `utiluti manage` will _ignore_ unmanaged defaults, i.e. defaults that come from local settings rather than configuration profiles. You can override this behavior with the `--include-unmanaged` option.
0 commit comments