Objective c 使用Cocoa或Applescript获取OSX中桌面上图标的大小

Objective c 使用Cocoa或Applescript获取OSX中桌面上图标的大小,objective-c,macos,cocoa,applescript,Objective C,Macos,Cocoa,Applescript,有没有办法用Cocoa或Applescript获得桌面上图标的大小?最好是可可粉。我用applescript这样做: set icon_size to word 3 of (do shell script "defaults read com.apple.finder DesktopViewSettings | grep iconSize") 您可以使用shell调用以类似的方式进行操作。我使用applescript以这种方式获得它: set icon_size to word 3 of (d

有没有办法用Cocoa或Applescript获得桌面上图标的大小?最好是可可粉。

我用applescript这样做:

set icon_size to word 3 of (do shell script "defaults read com.apple.finder DesktopViewSettings | grep iconSize")

您可以使用shell调用以类似的方式进行操作。

我使用applescript以这种方式获得它:

set icon_size to word 3 of (do shell script "defaults read com.apple.finder DesktopViewSettings | grep iconSize")

您可以使用shell调用以类似的方式进行操作。

您可以使用apple脚本

tell application "Finder"
    set p to get the properties of icon view options of the window of the desktop
    set iconSize to icon size of p
end tell

您可以使用apple脚本

tell application "Finder"
    set p to get the properties of icon view options of the window of the desktop
    set iconSize to icon size of p
end tell
看一看,看一看