TITLE
    Mac OS 8.5: Disk Positioning on Desktop after Startup
Article ID:
Created:
Modified:
30871
12/11/98
5/8/01

TOPIC

    This article tells how the Mac OS 8.5 and later, the Finder determines the position of disk volumes on the desktop.


DISCUSSION

    In Mac OS 8.5 and later, the Finder orders partitions on the desktop in the following manner:

    1. Startup partition.
    2. Non removable partitions.
    3. Removable partitions (like Zip, CD-ROM, and so forth).
    4. Mounted servers.

    Within groups 2, 3 and 4, the items are ordered by the amount of space used on the partition (as opposed to the size of the partition). Therefore, as one partition fills up, it's place in the ordering can change.

    If you want disks placed in a specific order, it could be performed by an AppleScript. Paste the following AppleScript into a Script Editor window:

    --Begin AppleScript
    property DiskNames : {}
    property DiskLocations : {}


    if DiskNames is {} then -- first time, initialize
    --capture current values to persistent property variables
    tell application "Finder"

    set DiskNames to the name of every disk of the desktop
    set DiskLocations to the position of every disk of the desktop

    end tell
    else

    --set positions from retained values
    repeat with i from 1 to number of DiskNames

    set DiskName to item i of DiskNames
    tell application "Finder"

    if disk DiskName of desktop exists then --present now?
    set the position of disk DiskName of desktop to item i of DiskLocations
    end if
    end tell

    end repeat
    end if
    --End AppleScript


    Save the AppleScript as an application with the "Never Show Startup Screen" option selected.

    Arrange the disks on your desktop as you want them to reappear after startup. Run this AppleScript application once to capture the current disk positions. Place this AppleScript application in your Startup Items folder and when it runs on each startup, it moves disks to the saved locations.

    If you wish to change the saved ordering of this applet, open it in the Script Editor, recompile and save it again. The first time it is run again, it recaptures the current disk positions.

    Note: This AppleScript as been compiled and is available at:

    ftp://ftp.info.apple.com//Apple_Support_Area/Apple_Software_Updates/English-North_American/Macintosh/Misc/AppleScript/Drive_Locations.hqx

    If you plan to change the disk order frequently and want more flexibility to interact with the AppleScript, here is another alternative. Replace the third line of the script (with the comment about first time, initialize) with the following:

    --Interactive AppleScript
    set DialogMsg to

    "Save current disk locations or restore locations from previously saved?" set DialogButtons to {"Cancel", "Save", "Restore"}

    display dialog DialogMsg with icon note buttons DialogButtons default button 3 set ButtonClicked to button returned of the result
    -- Cancel never even gets here

    -- if ButtonClicked is "Save" then

    With the addition of these statements, the AppleScript application asks you every time it is run whether you wish to save or restore the disk locations. This interaction may become annoying every time you start up your computer. The first AppleScript form quietly restores the disk positions without your interaction.

    Note: This AppleScript as been compiled and is available at:

    ftp://ftp.info.apple.com//Apple_Support_Area/Apple_Software_Updates/English-North_American/Macintosh/Misc/AppleScript/Drive_Locations.hqx


Document Information
Product Area: Mac OS System Software
Category: Mac OS 8.5
Sub Category: General OS Topics
Keywords: kmos85

Copyright © 2000 Apple Computer, Inc. All rights reserved.