Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 473 Bytes

README.md

File metadata and controls

37 lines (25 loc) · 473 Bytes

go-jxa

Go module for running JavaScript for Automation (JXA). Requires macOS 10.10 or later.

Install

$ go get github.com/wobsoriano/go-jxa

Usage

package main

import (
	"fmt"
	"log"

	jxa "github.com/wobsoriano/go-jxa"
)

func main() {
	code := "Application('System Events').appearancePreferences.darkMode()"
	v, err := jxa.RunJXA(code)

	if err != nil {
		log.Fatal(err.Error())
	}

	fmt.Printf("Is dark mode: %s", v)
}

License

MIT