Login  •  Register

The time is now: Tue Aug 04, 2020 12:28 am

Emaculation wiki  •  Delete all board cookies

Post new topic  Reply to topic Page 1 of 1 [ 1 post ]
Print view Previous topic  |  Next topic
Author Message
PostPosted: Sun Jul 09, 2017 1:32 pm 
Forum All-Star

Joined: Tue Oct 14, 2008 12:12 am
Posts: 1208
I noticed that my SheepShaver - OS 9.0.4 setup was acting strangely, and finally discovered that the invisible Temporary Items folder was stuffed with files. It turns out that this is a known bug, and that Apple had a solution. Here it is:

https://web.archive.org/web/20020627134 ... tnum=25134

For those who simply want the text of the AppleScript that should be compiled as a "classic applet" and put into the Startup Items folder, here it is:

--Empty temporary items on startup
--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
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
      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"
      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
            tell application "Finder" to move alias ItemPath to alias RescuedItemsPath
         on error
            --something unexpected happened, keep going
         end try
      end if
   end repeat
   -- probably fixed after this release
end if
--End AppleScript

Reply with quote Post a reply  
Display posts from previous:  Sort by  
Post new topic  Reply to topic Page 1 of 1 [ 1 post ]

Who is online

Users browsing this forum: Google [Bot] and 46 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group