how to get size of desktop icons

G’day from Oz

I’ve been mucking about writing a script to organize a block of icons, and have it right apart from getting the spacing automatic.

I can’t get the size of the desktop icons right. I’ve tried.

tell application "Finder"
	set spacingDistance to (icon size of icon view options of window of desktop)
	display dialog spacingDistance
end tell

.but it constantly returns 16 regardless of the icons size.

Could anyone advise me please of what is the correct wording?

Regards

Santa

Model: G5
AppleScript: 1.10.7
Browser: Safari 419.3
Operating System: Mac OS X (10.4)

Hi.

Your script properly gets the size of the icons in the window of the desktop folder, not on the desktop. It worked for me, correctly showing the icon size when I changed it.

According to this older thread - http://bbs.applescript.net/viewtopic.php?id=5370 - and a few others almost as old, what I think you are trying will not work. I didn’t see anything more recent that said otherwise.

You might be able to work around the problem with a GUI script acting on the “View Options” window (after closing all other windows.)

Post #7 of this thread - http://bbs.applescript.net/viewtopic.php?id=17813 - shows how to get that window.

Hope that helps.

j

Thanks capitalj.

I think under at least 10.4 it is possible to address the icon position.

Certainly with the script I’ve just submitted today I can re-set the desktop icon positions.

However, using the script above returns different values on different computers, so I think the script is correct, but I’ve found a bug.

How do you report script bugs to Apple? There only seems to be a mailing list nowadays.

Santa
P.S. What did you change it to to get it to work for you?

Model: G5
AppleScript: 1.10.7
Browser: Safari 419.3
Operating System: Mac OS X (10.4)

I don’t know how to report script bugs - I’m always responsible when a script errors. :stuck_out_tongue:

And this thread is more recent - http://bbs.applescript.net/viewtopic.php?id=16895 - but I haven’t tried the scripts.

Yikes, 2:30 a.m. - done for now.

Actual bugs can reported at: https://bugreport.apple.com/ (ADC account required)

Be sure to write a good bug report! Apple Bug Report Guide