Re: Problem getting position of desktop items
Re: Problem getting position of desktop items
- Subject: Re: Problem getting position of desktop items
- From: Graff <email@hidden>
- Date: Thu, 22 Jul 2004 15:11:09 -0400
On Jul 22, 2004, at 8:21 AM, Paul Skinner wrote:
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
So you are basically making a large window that shows all of the items
on the Desktop and then you arranging those items in that window?
Yeah, you can easily arrange stuff in a window but it's just not as
good as having a true Desktop. Now if you could fix that window so
that it always stayed in back of everything and couldn't be closed,
resized or moved then it might serve as a good replacement.
- Ken
_______________________________________________
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.