scriptingbridge

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Rendered for darwin/amd64

Overview

Package scriptingbridge provides a fluent Go API over the macOS ScriptingBridge framework.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	// contains filtered or unexported fields
}

Application wraps raw.SBApplication with a fluent Go API.

func ApplicationFromID

func ApplicationFromID(id objc.ID) *Application

ApplicationFromID adopts an existing object pointer as a Application (nil for 0).

func ApplicationWithBundleIdentifier

func ApplicationWithBundleIdentifier(ident string) *Application

ApplicationWithBundleIdentifier calls the underlying SBApplicationApplicationWithBundleIdentifier.

func ApplicationWithProcessIdentifier

func ApplicationWithProcessIdentifier(pid int) *Application

ApplicationWithProcessIdentifier calls the underlying SBApplicationApplicationWithProcessIdentifier.

func ApplicationWithURL

func ApplicationWithURL(url string) *Application

ApplicationWithURL calls the underlying SBApplicationApplicationWithURL.

func NewApplicationWithBundleIdentifier

func NewApplicationWithBundleIdentifier(ident string) *Application

NewApplicationWithBundleIdentifier creates a new Application.

func NewApplicationWithProcessIdentifier

func NewApplicationWithProcessIdentifier(pid int) *Application

NewApplicationWithProcessIdentifier creates a new Application.

func NewApplicationWithURL

func NewApplicationWithURL(url string) *Application

NewApplicationWithURL creates a new Application.

func (*Application) Activate

func (x *Application) Activate()

Activate calls the underlying Activate.

func (*Application) ClassForScriptingClass

func (x *Application) ClassForScriptingClass(className string) objc.Class

ClassForScriptingClass calls the underlying ClassForScriptingClass.

func (*Application) Delegate

func (x *Application) Delegate() raw.SBApplicationDelegate

Delegate calls the underlying Delegate.

func (*Application) ID

func (x *Application) ID() objc.ID

ID returns the underlying Objective-C object pointer (objc.ID), for passing to C APIs that take an object or CFTypeRef pointer.

func (*Application) IsRunning

func (x *Application) IsRunning() bool

IsRunning calls the underlying IsRunning.

func (*Application) LaunchFlags

func (x *Application) LaunchFlags() launchservices.LSLaunchFlags

LaunchFlags calls the underlying LaunchFlags.

func (*Application) SendMode

func (x *Application) SendMode() int

SendMode calls the underlying SendMode.

func (*Application) SetDelegate

func (x *Application) SetDelegate(delegate raw.SBApplicationDelegate)

SetDelegate calls the underlying SetDelegate.

func (*Application) SetLaunchFlags

func (x *Application) SetLaunchFlags(launchFlags launchservices.LSLaunchFlags)

SetLaunchFlags calls the underlying SetLaunchFlags.

func (*Application) SetSendMode

func (x *Application) SetSendMode(sendMode int)

SetSendMode calls the underlying SetSendMode.

func (*Application) SetTimeout

func (x *Application) SetTimeout(timeout int)

SetTimeout calls the underlying SetTimeout.

func (*Application) Timeout

func (x *Application) Timeout() int

Timeout calls the underlying Timeout.

func (*Application) Unwrap

func (x *Application) Unwrap() *raw.SBApplication

Unwrap returns the underlying raw.SBApplication.

func (*Application) WithDelegate

func (x *Application) WithDelegate(delegate raw.SBApplicationDelegate) *Application

WithDelegate sets the delegate property and returns the receiver for chaining.

func (*Application) WithLaunchFlags

func (x *Application) WithLaunchFlags(launchFlags launchservices.LSLaunchFlags) *Application

WithLaunchFlags sets the launchFlags property and returns the receiver for chaining.

func (*Application) WithSendMode

func (x *Application) WithSendMode(sendMode int) *Application

WithSendMode sets the sendMode property and returns the receiver for chaining.

func (*Application) WithTimeout

func (x *Application) WithTimeout(timeout int) *Application

WithTimeout sets the timeout property and returns the receiver for chaining.

type Applicationable

type Applicationable interface {
	Unwrap() *raw.SBApplication
	WithDelegate(delegate raw.SBApplicationDelegate) *Application
	WithLaunchFlags(launchFlags launchservices.LSLaunchFlags) *Application
	WithSendMode(sendMode int) *Application
	WithTimeout(timeout int) *Application
	ClassForScriptingClass(className string) objc.Class
	Activate()
	IsRunning() bool
	Delegate() raw.SBApplicationDelegate
	SetDelegate(delegate raw.SBApplicationDelegate)
	LaunchFlags() launchservices.LSLaunchFlags
	SetLaunchFlags(launchFlags launchservices.LSLaunchFlags)
	SendMode() int
	SetSendMode(sendMode int)
	Timeout() int
	SetTimeout(timeout int)
}

Applicationable is the interface implemented by Application, for mocking and DI.

type ElementArray

type ElementArray struct {
	// contains filtered or unexported fields
}

ElementArray wraps raw.SBElementArray with a fluent Go API.

func ElementArrayFromID

func ElementArrayFromID(id objc.ID) *ElementArray

ElementArrayFromID adopts an existing object pointer as a ElementArray (nil for 0).

func NewElementArray

func NewElementArray() *ElementArray

NewElementArray creates a new ElementArray.

func (*ElementArray) ArrayByApplyingSelector

func (x *ElementArray) ArrayByApplyingSelector(selector objc.SEL) *foundation.NSArray[objc.ID]

ArrayByApplyingSelector calls the underlying ArrayByApplyingSelector.

func (*ElementArray) ArrayByApplyingSelectorWithObject

func (x *ElementArray) ArrayByApplyingSelectorWithObject(aSelector objc.SEL, argument objc.ID) *foundation.NSArray[objc.ID]

ArrayByApplyingSelectorWithObject calls the underlying ArrayByApplyingSelectorWithObject.

func (*ElementArray) Get

func (x *ElementArray) Get() *foundation.NSArray[objc.ID]

Get calls the underlying Get.

func (*ElementArray) ID

func (x *ElementArray) ID() objc.ID

ID returns the underlying Objective-C object pointer (objc.ID), for passing to C APIs that take an object or CFTypeRef pointer.

func (*ElementArray) ObjectAtLocation

func (x *ElementArray) ObjectAtLocation(location objc.ID) objc.ID

ObjectAtLocation calls the underlying ObjectAtLocation.

func (*ElementArray) ObjectWithID

func (x *ElementArray) ObjectWithID(identifier objc.ID) objc.ID

ObjectWithID calls the underlying ObjectWithID.

func (*ElementArray) ObjectWithName

func (x *ElementArray) ObjectWithName(name string) objc.ID

ObjectWithName calls the underlying ObjectWithName.

func (*ElementArray) Unwrap

func (x *ElementArray) Unwrap() *raw.SBElementArray[objc.ID]

Unwrap returns the underlying raw.SBElementArray.

type ElementArrayable

type ElementArrayable interface {
	Unwrap() *raw.SBElementArray[objc.ID]
	ObjectWithName(name string) objc.ID
	ObjectWithID(identifier objc.ID) objc.ID
	ObjectAtLocation(location objc.ID) objc.ID
	ArrayByApplyingSelector(selector objc.SEL) *foundation.NSArray[objc.ID]
	ArrayByApplyingSelectorWithObject(aSelector objc.SEL, argument objc.ID) *foundation.NSArray[objc.ID]
	Get() *foundation.NSArray[objc.ID]
}

ElementArrayable is the interface implemented by ElementArray, for mocking and DI.

type Object

type Object struct {
	// contains filtered or unexported fields
}

Object wraps raw.SBObject with a fluent Go API.

func NewObject

func NewObject() *Object

NewObject creates a new Object.

func NewObjectWithData

func NewObjectWithData(data objc.ID) *Object

NewObjectWithData creates a new Object.

func NewObjectWithElementCodePropertiesData

func NewObjectWithElementCodePropertiesData(code uint, properties *foundation.NSDictionary[*foundation.NSString, objc.ID], data objc.ID) *Object

NewObjectWithElementCodePropertiesData creates a new Object.

func NewObjectWithProperties

func NewObjectWithProperties(properties *foundation.NSDictionary[objc.ID, objc.ID]) *Object

NewObjectWithProperties creates a new Object.

func ObjectFromID

func ObjectFromID(id objc.ID) *Object

ObjectFromID adopts an existing object pointer as a Object (nil for 0).

func (*Object) ElementArrayWithCode

func (x *Object) ElementArrayWithCode(code uint) *raw.SBElementArray[objc.ID]

ElementArrayWithCode calls the underlying ElementArrayWithCode.

func (*Object) Get

func (x *Object) Get() objc.ID

Get calls the underlying Get.

func (*Object) ID

func (x *Object) ID() objc.ID

ID returns the underlying Objective-C object pointer (objc.ID), for passing to C APIs that take an object or CFTypeRef pointer.

func (*Object) LastError

func (x *Object) LastError() unsafe.Pointer

LastError calls the underlying LastError.

func (*Object) PropertyWithClassCode

func (x *Object) PropertyWithClassCode(cls objc.Class, code uint) *Object

PropertyWithClassCode calls the underlying PropertyWithClassCode.

func (*Object) PropertyWithCode

func (x *Object) PropertyWithCode(code uint) *Object

PropertyWithCode calls the underlying PropertyWithCode.

func (*Object) SetTo

func (x *Object) SetTo(value objc.ID)

SetTo calls the underlying SetTo.

func (*Object) Unwrap

func (x *Object) Unwrap() *raw.SBObject

Unwrap returns the underlying raw.SBObject.

type ObjectProvider

type ObjectProvider interface {
	// contains filtered or unexported methods
}

ObjectProvider is implemented by Object and any idiomatic type wrapping a SBObject subclass.

type Objectable

type Objectable interface {
	Unwrap() *raw.SBObject
	Get() objc.ID
	LastError() unsafe.Pointer
	PropertyWithCode(code uint) *Object
	PropertyWithClassCode(cls objc.Class, code uint) *Object
	ElementArrayWithCode(code uint) *raw.SBElementArray[objc.ID]
	SetTo(value objc.ID)
}

Objectable is the interface implemented by Object, for mocking and DI.

Jump to

Keyboard shortcuts

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