在AppleScript中自定义窗口对话框的外观?

在AppleScript中自定义窗口对话框的外观?,applescript,Applescript,我想知道是否可以在Applescript中更改对话框窗口的外观,例如通过自定义图片或图标更改图标(注意、停止、警告) 如果可以更改排版(对齐、字体、粗体等) 如果是的话,你能帮我举一个代码示例或者提供一个好教程的链接吗 set folderName to text returned of (display dialog "Please enter new folder name:" default answer "Folder_Name") set loc to choose folder "C

我想知道是否可以在Applescript中更改对话框窗口的外观,例如通过自定义图片或图标更改图标(注意、停止、警告)

如果可以更改排版(对齐、字体、粗体等)

如果是的话,你能帮我举一个代码示例或者提供一个好教程的链接吗

set folderName to text returned of (display dialog "Please enter new folder name:" default answer "Folder_Name")
set loc to choose folder "Choose Parent Folder Location"

try
    tell application "Finder"
        set newFolder to make new folder at loc with properties {name:folderName}       
    end tell

    display dialog "Successfully! Want to reveal the new folder?" with icon note buttons {"Cancel", "Go to my new folder"} default button "Go to my new folder" cancel button "Cancel"
    if button returned of the result = "Go to my new folder" then
        tell application "Finder"
            reveal newFolder
            activate
        end tell
    end if
end try

你不能改变字体。但是,您可以使用:

display dialog "hi" with icon withIconFile

其中withIconFile是对“.icns”文件的别名或文件引用

这对我来说更好

 display dialog "My custom icon " buttons {"Cancel", "Continue"} default button "Continue" with icon file "Path:to:my.icon.icns"
您还可以执行以下操作:

display dialog "Hello" buttons {"Cancel", "Continue"} with icon {"/Users/" & (do shell script "whoami") & "/path/to/picture.jpg"}
do shell脚本
部分只是让它工作起来,即使你把它发送给你的朋友,尽管我建议你用curl从互联网上下载图像并将其放在一个文件夹中。如果有点混乱,很抱歉