• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problem getting position of desktop items
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Problem getting position of desktop items
      • From: Paul Skinner <email@hidden>
References: 
 >Problem getting position of desktop items (From: Allen Watson <email@hidden>)
 >Re: Problem getting position of desktop items (From: Graff <email@hidden>)
 >Re: Problem getting position of desktop items (From: Bill Briggs <email@hidden>)
 >Re: Problem getting position of desktop items (From: Paul Skinner <email@hidden>)

  • Prev by Date: RE: Error with AppleScript
  • Next by Date: GUI Scripting Illustrator's "Reader for DXF" plug-in DXF/DWG Options dialog
  • Previous by thread: Re: Problem getting position of desktop items
  • Next by thread: Re: Problem getting position of desktop items
  • Index(es):
    • Date
    • Thread