支持共享 AppleScriptObjC 变量来标记对象

Support With Sharing AppleScriptObjC Variable To Label Object

   script AppDelegate  

        property theWindow : missing value
        property displayLabel : missing value

            on applicationWillFinishLaunching:aNotification

                    display dialog "Are you ready?" buttons {"Yes", "No"} default button "Yes"

            end applicationWillFinishLaunching:

            if result = {button returned:"No"} then

                display alert "That's a shame."

                tell application "This Application"
                    quit
                end tell

            else if result = {button returned:"Yes"} then

                set testVariable to "this is a test"

            end if

    end script

所以,这是我在 AppleScriptObjC 中开发的应用程序示例。我已经删除了很多东西并用不同的字符串替换了东西,但这是基本布局。

如何将 'testVariable' 的值输入 'displayLabel' 属性,它链接到界面构建器中的标签?标签最初是空的,但我希望 'testVariable' 的值在脚本 运行.

后填充它

谢谢!!!

语法与 ObjC 语法非常相似

ObjC

displayLabel.stringValue = testVariable;

AppleScriptObjC

set displayLabel's stringValue to testVariable