Re: Problem getting position of desktop items
Re: Problem getting position of desktop items
- Subject: Re: Problem getting position of desktop items
- From: Paul Skinner <email@hidden>
- Date: Thu, 22 Jul 2004 08:21:43 -0400
On Jul 20, 2004, at 8:51 PM, Bill Briggs wrote:
At 8:07 PM -0400 20/07/2004, Graff wrote:
So far I believe there is no known method for positioning items on
the Desktop via AppleScript under Mac OS X.
Yes, this pathetically simple task in OS 9 is the new Holy Grail of
OS X scripting.
...
- web
This may be well-known and simply disliked, but you can hack around
this deficiency. Sort of.
tell application "Finder"
activate
set s to {(word 3 of (do shell script "defaults read
/Library/Preferences/com.apple.windowserver | grep -w Width")) as
number, (word 3 of (do shell script "defaults read
/Library/Preferences/com.apple.windowserver | grep -w Height")) as
number} --------------------------------------------------
open (path to desktop folder from user domain)
set dp to desktop picture
tell Finder window "Desktop"
set current view to icon view
set collapsed to false
set toolbar visible to false
set the bounds of it to {0, 22, (item 1 of s) + 15, (item 2 of s)}
end tell
set itemList to (every item of the desktop)
set positionList to (position of every item of the desktop)
repeat with thisItem in itemList
set the position of thisItem to {(item 1 of s) / 2, (item 2 of s) / 2}
delay 0.2
end repeat
repeat with i from 1 to length of itemList
set the position of item i of itemList to item i of positionList
delay 0.2
end repeat
end tell
Paul
--
Let me face the peril!
No! It's too perilous!
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.