【问题标题】:Apple script - How to show url link in dialog [duplicate]Apple脚本-如何在对话框中显示url链接[重复]
【发布时间】:2019-05-15 07:18:03
【问题描述】:

我想知道是否有任何方法可以在苹果脚本对话框中显示 URL 链接,以便用户能够单击该链接并自动打开它。

【问题讨论】:

  • 如果用户单击“确定”或按 Enter 键,为什么不直接对其进行编码以打开目标 URL。 AFAIK 基本标准 AppleScript 无法在显示对话框中显示可点击的超链接。

标签: macos url hyperlink dialog applescript


【解决方案1】:

我已经找到了如下解决方案,

osascript <<'END'
    set theAlertText to "Swiftlint is not installed"
    set theAlertMessage to "Download from https://github.com/realm/SwiftLint manually. Would you like to open link?"
    display alert theAlertText message theAlertMessage as critical buttons {"Cancel", "Open link"} default button "Open link" cancel button "Cancel" giving up after 60
    set the button_pressed to the button returned of the result
    if the button_pressed is "Open link" then
        open location "https://github.com/realm/SwiftLint/blob/master/README.md"
    end if
END

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-09-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-14
    • 2011-06-07
    • 2017-03-07
    • 2017-04-19
    相关资源
    最近更新 更多