Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Setting position of icons?

Setting position of icons?
Thread Tools
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Nov 21, 2001, 01:37 PM
 
I am trying to make this script that I made in OS 9 work in OS X. What it does is log your icon positions and then whenever you want you can restore them. Useful when switching resolutions.

Yet, when I tried to just do the set position snippet, no luck. I just need to know how to change the positions of the icons. Here is the script that works with OS 9 if it is of any help:

property theNames : {}
property thePositions : {}

on run
  set theDialog to button returned of (display dialog "This is a script meant to restore the positions of all of your icons on the desktop." & return & return & "Would you like to restore the positions of all your current icons or would you like to make my settings for the positions, that of the current icons on the desktop?" buttons {"Cancel", "Update Settings", "Restore Positions"} default button 3)
  
  if theDialog is not "Cancel" then
    tell application "Finder"
      if theDialog is "Restore Positions" then
        repeat with i from 1 to length of theNames
          try
            set theFile to item 1 of ((every item of folder ((name of startup disk) & ":Desktop Folder:") whose name is (item i of theNames)) as list)
            if position of theFile is not (item i of thePositions) then set position of theFile to item i of thePositions
          end try
        end repeat
        display dialog "Updated all positions." buttons {"OK"} default button 1
      else if theDialog is "Update Settings" then
        set theNames to name of every item of folder ((name of startup disk) & ":Desktop Folder:")
        set thePositions to position of every item of folder ((name of startup disk) & ":Desktop Folder:")
        display dialog "Updated current position settings." buttons {"OK"} default button 1
      end if
    end tell
  end if
end run

[ 11-21-2001: Message edited by: Synotic ]
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:14 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2