Leopard Write text file to Desktop does not show on Desktop

Have an error log writing to the desktop in the usual way (open file for write access, write, close).

When it is done, it does not appear on the Desktop. When I go to my hard drive and into my user folder into the “Desktop” folder, the file is right there. If I kill the Finder and relaunch it, the file shows up on my desktop.

Anyone else seen this?

Model: iMac Intel 10.5.5
Browser: Firefox 3.0.2
Operating System: Mac OS X (10.5)

One more test. If I delete (send to trash) from the Desktop folder, if I then undo it pops up on the desktop. Strange.

There’s an AppleScript/Finder command “update”

update‚v : Update the display of the specified object(s) to match their on-disk representation

which can be called after writing (or moving) a file to a Finder location like the desktop which will force the Finder to display changes. Sometimes the display refresh of icons on the desktop is slower than the display of icons in a folder window of the desktop. I’ve seen it happen even when using an application other than a script, such as Photoshop’s Save As…

set newFilePath to (path to desktop as string) & "test.txt"
set fileReference to open for access file newFilePath with write permission
write "New file data" to fileReference
close access fileReference
-- when I do this, the icon appears on the desktop immediately
-- if not, this may force it to display the new file's icon
tell application "Finder" to update desktop

Tho, I’ve not seen the behavior on my Intel iMac very often, if at all (a minute or less later and the icon suddenly appears). I did see it all the time on an old PowerMacG3.

Tried the refresh thing and it doesn’t work. Your code works run by itself but my code in the middle of my Xcode app but basically doing the same thing gives me problems.

I’ll experiment with where the command takes place. I don’t understand what the problem is though. If it shows up in the desktop folder, why wouldn’t it actually show up on the desktop??

Hmmmm… running by itself can mean different things; running as an applescript app, running as a script within another app, or run in the script editor. True, I did test it only by running in the script editor, tho I didn’t think that a Finder tell block would behave differently inside an Xcode app than it does in Script Editor. Then again, I always quickly-to-immediately see the file written to the desktop every time a script finishes, so I have no way of knowing whether or not the Finder ‘update’ command is the answer in the first place.

That’s a puzzler. Perhaps because of the way the Finder reads the contents a folder when it’s opened compared to how the Finder reads and displays the contents of the main screen (desktop “background” in front of background) in real time. Do you see the same problem on other Macs and only with the Xcode app? While not as hazardous or noticeable on my iMac, on my PowerMac I often have trouble with existing icons redrawing on the desktop, let alone new files showing up, after closing windows simply because I have too many applications running at once and free RAM is low. Might be a RAM or VRAM issue, and I haven’t tested to see if the ‘update’ command in the OS8.6 Finder on the PowerMac fixes the problem - tho it’s not a persistent problem and if a new file written by a script doesn’t show up right away, it does eventually.

Maybe if you wrote the file to the Document folder and then moved it to the desktop? If it still doesn’t show up I’d be inclined to think it was a hardware issue, not a script problem; but I’m completely oblivious to potential issues within an Xcode application as I’ve never built one of those.

hi - try deleting the com.apple.finder.plist file and reboot… can’t hurt… might help.



Browser: iCab 4.2.5
Operating System: Mac OS X (10.5)