TITLE
    Mac OS 9: Temporary Items Not Moved to Trash
Article ID:
Created:
Modified:
25134
3/13/00
4/13/01

TOPIC

    This article discusses an issue where Mac OS 9.0.x does not move items from the Temporary Items folder to the Trash if the computer stops responding or "freezes".


DISCUSSION

    Symptom

    The amount of available space on your computer's hard disk seems to be dramatically decreasing even though you're not saving any large files on it. This symptom seems to occur especially after the computer stops responding or "freezes" when you are using a graphics application like Photoshop.

    Products affected

    • Mac OS 9.0 through 9.0.4


    Solution

    Install Mac OS 9.1. An update to Mac OS 9.1 is available from Apple Software Updates ( http://www.apple.com/swupdates/ ).

    In Mac OS 9, there is an invisible folder named Temporary Items that applications can use to store temporary files. For example, a graphics application can save changes to an image as temporary files so that the user can undo, or revert back to previous changes. Normally, these temporary files are deleted when the user quits the application.

    If, however, the pointer "freezes" or the computer does not respond, the Finder moves any files in the Temporary Items folder to a Rescued Items folder in the Trash when the computer restarts. You can look in this folder for any items you wish to recover, or you can empty the Trash to recover the disk space.

    With Mac OS 9.0.x, the Finder does not move files from the Temporary Items folder to the Trash. This can result in a noticeable loss of available space depending on how large the files are. This situation has been corrected in Mac OS 9.1.

    If you don't update to Mac OS 9.1 you can use the AppleScript below as a startup item. Follow these steps to make the AppleScript applet:
      1. Open the Script Editor, located in the AppleScript folder of the Apple Extras folder on the hard disk.
      2. Copy and paste the AppleScript statements below into the Script Editor window.
      3. Choose Save from the File menu and type a filename, such as Temporary Items Cleaner.
      4. In the Save As dialog box, choose classic applet from the Format pop-up menu; two additional options appear in the dialog.
      Note: If using Mac OS 8.6 or earlier, the Save As dialog reads Application, not classic applet.
      5. Click Never Show Startup Screen.
      6. Navigate to the Startup Items folder of the System Folder, and click Save.

    This creates a small startup applet that works only with the versions of Mac OS 9.0.x that have this condition. It emulates the Finder's expected behavior by creating a folder called Rescued Items in the Trash that will contain any items found in the Temporary Items invisible folder. You can look in this folder for any items you wish to recover, or you can empty the Trash to recover the disk space.

    --Begin AppleScript
    tell application "Finder" to get the version
    set FinderVersion to the result as text
    if FinderVersion is less than "9.0" then
    display dialog "This AppleScript requires Mac OS 9 or later."¬

    with icon stop buttons "OK" default button 1
    return
    end if

    if FinderVersion is less than "9.1" then -- version with problem
    tell application "Finder" to set BootVol to name of startup disk
    set TmpItems to BootVol & ":Temporary Items:" as text

    try
    set FolderContents to list folder TmpItems without invisibles
    if (count of FolderContents) is 0 then return
    on error
    return -- probably no folder exists
    end try

    --Are there Rescued Items folders in the Trash already?
    tell application "Finder" to get every item of trash ¬
    whose name begins with "Rescued Items"
    set RescuedCnt to count of the result
    if RescuedCnt is 0 then
    set RescuedItemName to "Rescued Items"
    else
    set RescuedCnt to RescuedCnt + 1
    set RescuedItemName to "Rescued Items " & RescuedCnt as text
    end if

    tell application "Finder"
    --Finder cannot create new folders in the trash, so make one

    --on the desktop...
    make new folder at desktop with properties {name:RescuedItemName}
    -- and then move it to the trash
    move folder RescuedItemName of desktop to trash
    end tell
    --construct the rescue target path
    set RescuedItemsPath to BootVol & ":Trash:" & RescuedItemName & ":" ¬

    as text

    repeat with FolderItem in FolderContents
    set ItemPath to TmpItems & FolderItem as text
    set ItemInfo to info for alias ItemPath
    set ItemIsFolder to folder of ItemInfo
    if ItemIsFolder then -- It's a folder
    set ItemCanBeMoved to true
    else -- It's a file
    --busy check requires Mac OS 9 Standard Additions
    set ItemCanBeMoved to not busy status of ItemInfo
    end if
    if ItemCanBeMoved then
    try
    tell application "Finder" to move alias ItemPath to ¬
    alias RescuedItemsPath
    on error
    --something unexpected happened, keep going
    end try
    end if
    end repeat
    else
    -- probably fixed after this release
    end if
    --End AppleScript


    Note: A compiled version of this AppleScript is available at:

    ftp://ftp.info.apple.com/Apple_Support_Area/Apple_Software_Updates/English-North_American/Macintosh/Misc/AppleScript/Remove_Temp_Items.bin


Document Information
Product Area: Mac OS System Software
Category: Mac OS 9.0
Sub Category: Troubleshooting
Keywords: kmos90, kmos91, ksts

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