James
James

Reputation: 509

Get size of icons on desktop in OSX using Cocoa or Applescript

Is there any way to get the size of the icons on the desktop in Cocoa or Applescript? Preferably in cocoa.

Upvotes: 1

Views: 238

Answers (2)

Parag Bafna
Parag Bafna

Reputation: 22930

You can use apple script

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

Upvotes: 0

adamh
adamh

Reputation: 3292

I use applescript to get it this way:

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

You could do in Cocoa a similar way using a shell call.

Upvotes: 1

Related Questions