我可以在不同的地方找到如何个性化AppleScript图标:https://apple.stackexchange.com/questions/8299/how-do-i-make-an-applescript-file-into-a-mac-app Customize Applescript app icon
苹果还谈到了常规Xcode应用程序中不同图标的分辨率:https://developer.apple.com/library/archive/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Optimizing/Optimizing.html
但是推荐的AppleScript图标应用程序的分辨率是多少?
发布于 2019-10-01 15:05:03
如果您在Finder中右键单击一个应用程序文件并选择“显示包内容”选项(如果您打开它的.icns文件(通常位于资源文件夹中),使用预览应用程序,使用侧栏中的缩略图视图,您将注意到该文件中包含多个相同图标的版本。每一个都有不同的大小和分辨率(1024x1024以每英寸144个像素,512x512以每英寸72个像素等)
我确信系统会根据具体情况决定使用哪个版本和大小的嵌入式图标。例如,在Dock中使用的图标大小将大于在应用程序运行时为应用程序打开的广告所使用的图标。

如果您希望更改AppleScript小程序的图标,请使用Finder中的get信息窗口中的.png文件。256 x 256每英寸72像素应该可以。
发布于 2019-10-01 14:33:40
图标大小由系统使用,而不是由AppleScript使用,因此无论系统想要什么“常规”应用程序,都应该在AppleScript应用程序中使用。
编辑
根据其他答案之一的注释,下面的脚本将创建一个icns文件,其中包含您选择的任何图像中的所有建议大小:
set picFile to choose file with prompt "Choose an image to iconize." of type {"public.image"}
set workingFolder to POSIX path of (path to temporary items from user domain)
set outputFolder to POSIX path of (path to desktop from user domain)
set sizesList to {16, 32, 128, 256, 512}
tell application "System Events"
set pictureFilePath to quoted form of (get POSIX path of picFile)
set {pictureName, ext} to {name, name extension} of picFile
if ext is not "" then
set pictureName to text 1 through -((length of ext) + 2) of pictureName
end if
-- create iconset folder
set iconsetFolder to make new folder at folder workingFolder with properties {name:pictureName & ".iconset"}
-- cycle through sizes to create normal and hi-def sized icon images
repeat with thisSize in sizesList
set iconFilePath to POSIX path of iconsetFolder & "/" & my makeFileNameFromSize(thisSize, false)
do shell script "sips -z " & thisSize & " " & thisSize & " " & "-s format png " & pictureFilePath & " --out " & iconFilePath
set iconFilePath to POSIX path of iconsetFolder & "/" & my makeFileNameFromSize(thisSize, true)
do shell script "sips -z " & thisSize * 2 & " " & thisSize * 2 & " " & "-s format png " & pictureFilePath & " --out " & iconFilePath
end repeat
-- create new icns file
set iconsetPath to quoted form of (POSIX path of iconsetFolder as text)
set outputPath to quoted form of (outputFolder & pictureName & ".icns")
do shell script "iconutil -c icns -o " & outputPath & " " & iconsetPath
end tell
on makeFileNameFromSize(s, x2)
set fileName to "icon_" & s & "x" & s
if x2 then set fileName to fileName & "@2x"
set fileName to fileName & ".png"
return fileName
end makeFileNameFromSize注意事项:
outputFolder变量来更改。如果图像文件名中有一些字符被shell解释为有意义,则https://stackoverflow.com/questions/58186668
复制相似问题