• 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: Paul Skinner <email@hidden>
  • Date: Fri, 23 Jul 2004 09:47:40 -0400

That is an early (and apparently not universally functional) method for determining the screen dimensions. To test the script set the value of 's' to your screen dimensions, width first, as a list of integers. i.e. {1280,854}
Defaults Read is a command that allows for the exploration of the defaults (preferences) system in OS X.
Try...
do shell script "man defaults"
-->...allows users to read, write, and delete Mac OS X user defaults
from a command-line shell. Mac OS X applications and other programs use
the defaults system to record user preferences and other information that
must be maintained when the applications aren't running (such as default
font for new documents, or the position of an Info panel).

Paul
PS what's your environment? I'd like to know why the shell script failed.

On Jul 23, 2004, at 1:11 AM, Bernard Azancot wrote:

Hi,

I have tried this script, but got an error 1 message with the following code selection:
--
do shell script "defaults read /Library/Preferences/com.apple.windowserver | grep -w Width"
--
What's the problem ?
What is "defaults read " ?

Yours,

Bernard

Le 22 juil. 04, ` 22:41, Paul Skinner <email@hidden> a icrit :

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
_______________________________________________
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.
_______________________________________________
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.


References: 
 >Re: Problem getting position of desktop items (From: Bernard Azancot <email@hidden>)

  • Prev by Date: [ANN] PreFab UI Actions Public Beta 2
  • Next by Date: Re: Mod or Creation Date
  • Previous by thread: Re: Problem getting position of desktop items
  • Next by thread: Re: Problem getting position of desktop items
  • Index(es):
    • Date
    • Thread