【发布时间】:2019-05-15 07:18:03
【问题描述】:
我想知道是否有任何方法可以在苹果脚本对话框中显示 URL 链接,以便用户能够单击该链接并自动打开它。
【问题讨论】:
-
如果用户单击“确定”或按 Enter 键,为什么不直接对其进行编码以打开目标 URL。 AFAIK 基本标准 AppleScript 无法在显示对话框中显示可点击的超链接。
标签: macos url hyperlink dialog applescript
我想知道是否有任何方法可以在苹果脚本对话框中显示 URL 链接,以便用户能够单击该链接并自动打开它。
【问题讨论】:
标签: macos url hyperlink dialog applescript
我已经找到了如下解决方案,
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
【讨论】: