从 Applescript 调用 Swift/objective-c 方法
Call Swift/objective-c method from Applescript
我正在尝试从带有参数的 applescript 中调用 swift 或 Objective-C API。目前我的 Objective-C 方法如下所示 -
- (void)updateInfoLabel:(NSString*)information;
我正在尝试从 AppleScript 中将其调用为 -
on infoUpdate()
current application's MyClass's alloc()'s init()'s updateInfoLabel("Hello World")
end infoUpdate
如有任何帮助,将不胜感激。
终于,我弄明白了。下面是我们如何从苹果脚本调用 Objective-C 方法 -
on infoUpdate()
current application's MyClass's alloc()'s init()'s updateInfoLabel:"Hello World"
end infoUpdate
重要的是,我们不必传递括号中的参数,而是必须在 :(冒号)
之后发送
我正在尝试从带有参数的 applescript 中调用 swift 或 Objective-C API。目前我的 Objective-C 方法如下所示 -
- (void)updateInfoLabel:(NSString*)information;
我正在尝试从 AppleScript 中将其调用为 -
on infoUpdate()
current application's MyClass's alloc()'s init()'s updateInfoLabel("Hello World")
end infoUpdate
如有任何帮助,将不胜感激。
终于,我弄明白了。下面是我们如何从苹果脚本调用 Objective-C 方法 -
on infoUpdate()
current application's MyClass's alloc()'s init()'s updateInfoLabel:"Hello World"
end infoUpdate
重要的是,我们不必传递括号中的参数,而是必须在 :(冒号)
之后发送