Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Optimize images for Desktop Background display' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Optimize images for Desktop Background display
Authored by: wallybear on Oct 26, '10 08:03:57AM

Instead of fixing screen size in the script you can set it programmatically:


tell application "Finder"
set _theScreen to bounds of window of desktop
set _screenWidth to item 3 of _theScreen
set _screenHeight to item 4 of _theScreen
end tell

So it will work even if you change your screen resolution.



[ Reply to This | # ]
Optimize images for Desktop Background display
Authored by: philostein on Oct 26, '10 11:18:22AM
Yeah, I was thought about that, but I read that it's not useful when there are multiple displays:
http://bit.ly/akSeai
Also, it fails when the Desktop window has been deactivated. ;)

This might be better:
set command to "/usr/sbin/system_profiler SPDisplaysDataType | grep Resolution"
set output to words of (do shell script command)
set {dspwidth, dspheight} to {item 2, item 4} of output

I'm not too down with Terminal though…

[ Reply to This | # ]
Optimize images for Desktop Background display
Authored by: wallybear on Oct 26, '10 02:18:06PM
Yes, that works.
This also works:

set _dims to do shell script "defaults read /Library/Preferences/com.apple.windowserver | grep -m 2  -w 'Height\\|Width'"
set {_screenHeight, _screenWidth} to {third word of _dims as number, sixth word of _dims as number}
Edited on Oct 26, '10 02:20:51PM by wallybear


[ Reply to This | # ]