Documentation
¶
Overview ¶
Package scriptingbridge provides a fluent Go API over the macOS ScriptingBridge framework.
Index ¶
- type Application
- func ApplicationFromID(id objc.ID) *Application
- func ApplicationWithBundleIdentifier(ident string) *Application
- func ApplicationWithProcessIdentifier(pid int) *Application
- func ApplicationWithURL(url string) *Application
- func NewApplicationWithBundleIdentifier(ident string) *Application
- func NewApplicationWithProcessIdentifier(pid int) *Application
- func NewApplicationWithURL(url string) *Application
- func (x *Application) Activate()
- func (x *Application) ClassForScriptingClass(className string) objc.Class
- func (x *Application) Delegate() raw.SBApplicationDelegate
- func (x *Application) ID() objc.ID
- func (x *Application) IsRunning() bool
- func (x *Application) LaunchFlags() launchservices.LSLaunchFlags
- func (x *Application) SendMode() int
- func (x *Application) SetDelegate(delegate raw.SBApplicationDelegate)
- func (x *Application) SetLaunchFlags(launchFlags launchservices.LSLaunchFlags)
- func (x *Application) SetSendMode(sendMode int)
- func (x *Application) SetTimeout(timeout int)
- func (x *Application) Timeout() int
- func (x *Application) Unwrap() *raw.SBApplication
- func (x *Application) WithDelegate(delegate raw.SBApplicationDelegate) *Application
- func (x *Application) WithLaunchFlags(launchFlags launchservices.LSLaunchFlags) *Application
- func (x *Application) WithSendMode(sendMode int) *Application
- func (x *Application) WithTimeout(timeout int) *Application
- type Applicationable
- type ElementArray
- func (x *ElementArray) ArrayByApplyingSelector(selector objc.SEL) *foundation.NSArray[objc.ID]
- func (x *ElementArray) ArrayByApplyingSelectorWithObject(aSelector objc.SEL, argument objc.ID) *foundation.NSArray[objc.ID]
- func (x *ElementArray) Get() *foundation.NSArray[objc.ID]
- func (x *ElementArray) ID() objc.ID
- func (x *ElementArray) ObjectAtLocation(location objc.ID) objc.ID
- func (x *ElementArray) ObjectWithID(identifier objc.ID) objc.ID
- func (x *ElementArray) ObjectWithName(name string) objc.ID
- func (x *ElementArray) Unwrap() *raw.SBElementArray[objc.ID]
- type ElementArrayable
- type Object
- func NewObject() *Object
- func NewObjectWithData(data objc.ID) *Object
- func NewObjectWithElementCodePropertiesData(code uint, properties *foundation.NSDictionary[*foundation.NSString, objc.ID], ...) *Object
- func NewObjectWithProperties(properties *foundation.NSDictionary[objc.ID, objc.ID]) *Object
- func ObjectFromID(id objc.ID) *Object
- func (x *Object) ElementArrayWithCode(code uint) *raw.SBElementArray[objc.ID]
- func (x *Object) Get() objc.ID
- func (x *Object) ID() objc.ID
- func (x *Object) LastError() unsafe.Pointer
- func (x *Object) PropertyWithClassCode(cls objc.Class, code uint) *Object
- func (x *Object) PropertyWithCode(code uint) *Object
- func (x *Object) SetTo(value objc.ID)
- func (x *Object) Unwrap() *raw.SBObject
- type ObjectProvider
- type Objectable
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 NewObjectWithData ¶
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 ¶
ObjectFromID adopts an existing object pointer as a Object (nil for 0).
func (*Object) ElementArrayWithCode ¶
ElementArrayWithCode calls the underlying ElementArrayWithCode.
func (*Object) 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) PropertyWithClassCode ¶
PropertyWithClassCode calls the underlying PropertyWithClassCode.
func (*Object) PropertyWithCode ¶
PropertyWithCode calls the underlying PropertyWithCode.
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.