Friday, September 3, 2010

#1 2006-04-16 10:15:34 pm

Bruce Phillips
Administrator
Registered: 2004-07-15
Posts: 2647

Finder: Desktop Icon Position (and Window Position)

(Requires Mac OS X v10.4)

Save the current position of desktop icons so they can be repositioned later:

Applescript:

property theList : missing value

tell application "Finder"
   activate
   
   if theList is not missing value then
       display dialog "Desktop icon positions…" buttons {"Save", "Cancel", "Reapply"} default button 3
   else
       display dialog "Desktop icon positions…" buttons {"Save"} default button 1
   end if
   
   if (button returned of result) is "Reapply" then
       repeat with i from 1 to (count (first item of theList))
           try
               set desktop position of item (item i of first item of theList) of desktop to (item i of second item of theList)
           end try
       end repeat
   else
       set theList to {name, desktop position} of items of desktop
   end if
   
   beep
end tell

Save as an application or run from the script menu.


Filed under: Finder

Offline

 

#2 2006-04-17 11:59:19 am

mark hunte
Member
From: Hello, London Calling
Registered: 2006-03-20
Posts: 907

Re: Finder: Desktop Icon Position (and Window Position)

Very nice, I use this sort of thing at work, to keep folders we use for work flow in the same place.
Also use a script to do the same for open windows. All in os9,

We are moving over to 10.4 and I needed to do the same there.

Your script helps in one fell sweep to map the icons. Thanks

I have also made one for finder windows.

for work I will combine the two.

Applescript:

property theList : missing value
property targList : {}

tell application "Finder"
   activate
   set i to ""
   if theList is not missing value then
       display dialog "Window positions…" buttons {"Save", "Cancel", "Reapply"} default button 3
   else
       display dialog "Window positions…" buttons {"Cancel", "Save"} default button 2
   end if
   
   if (button returned of result) is "Reapply" then
       repeat with i from 1 to (count (items of targList))
           set the_name to (item i of first item of theList) as string
           if not (exists (some Finder window whose name is the_name)) then
               get targList
               set targ to (item i of targList) as string
               open targ
           end if
       end repeat
       repeat with i from 1 to (count (first item of theList))
           try
               set bounds of window (item i of first item of theList) to (item i of second item of theList)
               
               set current view of window (item i of first item of theList) to (item i of third item of theList)
               
           end try
       end repeat
   else
       set theList to {name, bounds, current view} of Finder windows
       repeat with i from 1 to (count of Finder windows)
           copy target of Finder window i to end of targList
           
       end repeat
   end if
   
end tell

Last edited by mark hunte (2006-04-18 05:11:25 am)


Tap,tap,tap , hello , testing 1..2,  1...2,

Filed under: Finder

Offline

 

Board footer

Powered by FluxBB

[ Generated in 0.234 seconds, 10 queries executed ]

RSS (new topics) RSS (active topics)