【问题标题】:How to hide a Label and show it when a button is pressed in AppleScript app?如何在 AppleScript 应用程序中按下按钮时隐藏标签并显示它?
【发布时间】:2018-12-29 23:29:19
【问题描述】:

我想知道如何使用 AppleScript 隐藏/显示标签我尝试过类似的方法:

property label : missing value
    if label's isHidden() = 1
                label's setHidden_(0)
            end if

但没有工作。

【问题讨论】:

    标签: xcode applescript applescript-objc


    【解决方案1】:

    要执行 AppleScript if 表达式,您必须将 ObjC BOOL 强制转换为 AppleScript boolean。
    但是您可以在 setter 中传递 AppleScript boolean。

    if label's isHidden() as boolean then -- is true is redundant 
       label's setHidden:false
    end if
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-02
      • 1970-01-01
      • 2011-06-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多