"refresh" the Finder?

Terry Judd tsj at unimelb.edu.au
Thu Feb 3 19:16:56 EST 2005


> From: "Chris Sheffield" <revlist at cableone.net>
> Date: Fri Feb 4, 2005  7:23:15  AM Australia/Melbourne
> To: "RevList" <use-revolution at lists.runrev.com>
> Subject: "refresh" the Finder?
> Reply-To: How to use Revolution <use-revolution at lists.runrev.com>
>
>
> Does anyone know of some way that one can “refresh” the Finder under 
> OS X?
> I’m not even really sure if that’s the right question or not.  Let me
> explain.
>
> I have an application that runs from CD-ROM.  When the program 
> launches, it
> copies certain temporary files to the user’s preferences folder on the 
> hard
> drive.  When the program exits, it deletes those files if the user 
> chooses
> to.  The problem is that the folder where I store the files does not 
> really
> get deleted or something.  It’s hard to explain.  But if I navigate to 
> the
> Preferences folder, I see my temporary folder momentarily before it
> disappears.  Now, if I do that in between sessions of running my
> application, everything’s fine.  But if I don’t, then when the app runs
> again, I get a file copy error.  And it's strange because you would 
> think
> that if the files were there it would just overwrite them, but that's 
> not
> the case.  Anyone know why this would be?  Has anyone seen anything 
> like
> this before?  It’s kind of the same thing where if you save a file 
> from some
> program (TextEdit for example) the file does not always appear listed 
> in the
> Finder until you refresh the view somehow (move to another folder then
> back).
>
> Anyone have any ideas on this?  Something in Transciprt would be 
> great, but
> AppleScript or a shell command would be welcome too.

Chris - I had the same (very frustrating) problem a while back. No fix, 
sorry, but a couple of workarounds...
1. use applescript to move the files to the trash...

this script will move a specifed folder (containing your files) to the 
trash (sort of what you want?)

on trashMacFolder srcFolder
     if there is a folder srcFolder then
       put "tell application" && quote & "Finder" & quote & cr & tab & 
"move folder" && revPathtoApplescript(srcFolder) && "to trash" && cr & 
"end tell" into tScript
       do tScript as AppleScript
     end if
end trashMacFolder

2. use the rename command to move them to the trash

Cheers,

Terry...

>
> Thanks,
>
> Chris Sheffield
> Software Development
> Read Naturally
> csheffield at readnaturally.com
Dr Terry Judd
Lecturer in Educational Technology (Design)
Biomedical Multimedia Unit
Faculty of Medicine, Dentistry & Health Sciences
The University of Melbourne
Parkville VIC 3052
AUSTRALIA



More information about the Use-livecode mailing list