macos-open

command
v1.17.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command macos-open shows what the system asks the app to open (step 56.1): the links of a URL scheme the app handles and the files of a type it opens, which macOS sends to the app as events and not as arguments (ui.OpenRequest, PlatformDispatcher.AddOpenRequestListener). The window lists them, with the arguments of the program, which is where the other systems put them.

The app must be a bundle whose Info.plist names the scheme and the file type, so build it with glutter-macos:

go run ./cmd/glutter-macos build -o /tmp/Open.app -name Open -url-scheme glutter-open \
    -doc-type "Glutter open test=glutteropen" ./examples/dev/macos-open
open /tmp/Open.app                       # registers the bundle with Launch Services and starts it
open "glutter-open://hello?x=1"          # the link reaches the running app
touch /tmp/a.glutteropen && open /tmp/a.glutteropen   # so does the file, also when the app is not running

Environment, in debug builds (-debug): GLUTTER_DEV_OPEN_LOG=<file> appends a line to the file for the start ("ready <pid>"), for each URL ("url <url>") and for each file ("file <path>"), which the test of the step reads.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL