• 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: How to modify Grid Spacing ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to modify Grid Spacing ?


  • Subject: Re: How to modify Grid Spacing ?
  • From: "L. Lee" <email@hidden>
  • Date: Thu, 20 Dec 2012 13:06:28 -0600
  • Thread-topic: How to modify Grid Spacing ?



On 12/20/12 12:46 PM, "Robert Poland" <email@hidden> wrote:


On Dec 20, 2012, at 11:37 AM, "L. Lee" <email@hidden> wrote:

From: "koenig.yvan" <email@hidden>
Date: Thursday, December 20, 2012 12:01 PM
To: liste AppleScript US <email@hidden>
Subject: Re: How to modify Grid Spacing ?
Le 20/12/2012 à 17:55, L. Lee <email@hidden> a écrit :
Aren't they referred to as iCons now?
But setting icon (iCon) size is desirable, as well.
Anyway, it appears that you don't have to use UI scripting to set grid spacing, as this script generated by Desktop Wrap illustrates.
(I really must find time to incorporate the disk listing that I demonstrated at Mac OS X Hints into Desktop Wrap so the sorting is more correct.)
-----
tell application "System Events"
tell process "Finder"
set screensize to size of first scroll area whose position is {0, 0}
end tell
end tell
The piece of code above IS GUI scripting.
Yvan KOENIG (VALLAURIS, France) jeudi 20 décembre 2012 19:00:39
--------------------------
Alrighty, then, maybe I can google 'applescript "get screen size" without GUI Scripting', but my point was that the iCon's positions can be set without it.
LL

tell (do shell script "/usr/sbin/system_profiler SPDisplaysDataType | grep Resolution") to set {monitor_R, monitor_B} to {word 2 as number, word 4 as number} -- get screen size for monitor


Robert Poland - Fort Collins, CO




Thanks! Please replace my original reply's submission with the following, and you can turn off access for assistive devices (assuming you want your icons where your menu bar is).

------

set screen_Rez to do shell script "/usr/sbin/system_profiler SPDisplaysDataType | grep Resolution"

set screenlist to paragraphs of screen_Rez

repeat with i in screenlist

set screenstuff to contents of i

set screen_width to word 2 of screenstuff as number

set screen_height to word 4 of screenstuff as number

set screensize to {screen_width, screen_height}

end repeat

set {_width, _height} to screensize

set firstcol_dist to 0.5 * 140

set iconcol_dist to ((_height - firstcol_dist) / 17)

set heightdistance to (_height - iconcol_dist)

set col1 to _width - firstcol_dist

set a to col1

set b to 52

tell application "Finder"

set disklist to ((every item of desktop) whose class is disk)

set itemlist to (every item of desktop) whose class is not disk

if "Kind" is in {"Name"} then

set desktoplist to sort itemlist by name

else if "Kind" is in {"Modification Date"} then

set desktoplist to sort itemlist by modification date

else if "Kind" is in {"Creation Date"} then

set desktoplist to sort itemlist by creation date

else if "Kind" is in {"Kind"} then

set desktoplist to sort itemlist by kind

end if

if 0 is 1 then

set desktoplist to reverse of itemlist

end if

set newlist to (disklist & desktoplist)

set this_item to 0

repeat with i from 1 to count of newlist

set this_item to this_item + 1

set diskcount to (count of disklist)

if this_item > diskcount then

set desktarg to (item (i - diskcount) of desktoplist)

else

set desktarg to (item i of disklist)

end if

if this_item / 17 = (this_item / 17 as integer) then

if this_item = 17 then

set a to col1 - 7

if this_item > diskcount then

set (desktop position of desktarg) to {a, b}

else

set (desktop position of item i) to {a, b}

end if

else

set a to ((_width - ((round (this_item / 17)) * (147))) + (firstcol_dist))

if b > heightdistance then

set b to iconcol_dist

else

set b to (b + iconcol_dist)

end if

if this_item > diskcount then

set (desktop position of desktarg) to {a, b}

else

set (desktop position of item i) to {a, b}

end if

end if

else if this_item / 17 is not (this_item / 17 as integer) then

if this_item < 17 then

set a to col1 - 7

if this_item > diskcount then

set (desktop position of desktarg) to {a, b}

else

set (desktop position of item i) to {a, b}

end if

if b > heightdistance then

set b to iconcol_dist

else

set b to (b + iconcol_dist)

end if

else if this_item = 17 then

set a to col1 - 7

if this_item > diskcount then

set (desktop position of desktarg) to {a, b}

else

set (desktop position of item i) to {a, b}

end if

else

set a to ((_width - ((round (this_item / 17) rounding up) * (147))) + (firstcol_dist))

if b > heightdistance - firstcol_dist then

set b to 52

else

set b to (b + iconcol_dist)

end if

if this_item > diskcount then

set (desktop position of desktarg) to {a, b}

else

set (desktop position of item i) to {a, b}

end if

end if

end if

end repeat

end tell

------

Laine Lee
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: How to modify Grid Spacing ? (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: How do you know if the folder is Shared
  • Next by Date: Re: How do you know if the folder is Shared
  • Previous by thread: Re: How to modify Grid Spacing ?
  • Next by thread: Re: How to modify Grid Spacing ?
  • Index(es):
    • Date
    • Thread