Macos 为什么我的Applescript将背景图像添加到.dmg文件夹会导致大小错误?

Macos 为什么我的Applescript将背景图像添加到.dmg文件夹会导致大小错误?,macos,applescript,Macos,Applescript,我正在使用以下Applescript设置.dmg文件夹的设置、图标间距等: on run argv tell application "Finder" set diskname to item 1 of argv tell disk diskname open set current view of container window to icon view set toolbar visible of container wind

我正在使用以下Applescript设置.dmg文件夹的设置、图标间距等:

on run argv
tell application "Finder"
    set diskname to item 1 of argv
    tell disk diskname
        open
        set current view of container window to icon view
        set toolbar visible of container window to false
        set statusbar visible of container window to false
        set bounds of container window to {400, 100, 900, 699}
        set theViewOptions to the icon view options of container window
        set arrangement of theViewOptions to not arranged
        set icon size of theViewOptions to 100
        set background picture of theViewOptions to file "background.png"
        set file_list to every file
        repeat with i in file_list
            if the name of i is "Applications" then
                set the position of i to {368, 135}
            else if the name of i ends with ".app" then
                set the position of i to {134, 135}
            end if
            -- Change the 7 to change the color: 0 is no label, then red,
            -- orange, yellow, green, blue, purple, or gray.
            set the label index of i to 7
        end repeat
        update without registering applications
        delay 4
    end tell
end tell
end run

窗口设置正确,但有一个例外:500x600 background.png图像缩小到原始大小的三分之一左右,并放置在左上角。我无法解释为什么会发生这种情况。有什么建议吗?

天哪,这真是st00pid

我在OSX Lion上遇到了这个问题。原来Lion要求文件夹的背景图像设置为72 DPI。我使用的图像是200 DPI,所以Lion将其从实际像素缩小


我以72 DPI的声明分辨率重新保存了该图像,它工作得非常完美。

这并不愚蠢,它只是选择了一种方式而不是另一种方式。在很多情况下,扩展图像以显示每个像素而不遵守其声明的分辨率将是无益的行为。我正试图做同样的事情,以.dmg为背景,你能告诉我我需要的完整代码是什么吗?