I've got this script that copies files and folders around. Works
fine, except when working with files/folders located on a file
server (just 10.4 with File Sharing).
Basically after creating a new folder on the server volume, and
copying files into it, the file types remain undefined (something
like <øˇÚ >) until I manually open the window in the Finder (When
I do this the Finder initially displays "empty outlined" icons for
the files, and a couple of seconds later the proper icons).
I tried using "update folder" before accessing its content, but to
no avail.
Any ideas ?
I was able to reproduce a problem with the following script, though I
get "missing value" for the result. I don't know where "<øˇÚ >"
would come from. Is this similar to your script?
-- "window 1" is open to a local HFS+ disk
tell application "Finder" to make new file at window 1 with
properties {name:"TESTFILE", file type:"ABCD"}
-- "Extra1" is an AppleShare server volume
tell application "Finder"
duplicate item "TESTFILE" of window 1 to disk "Extra1" with replacing
get file type of item "TESTFILE" of disk "Extra1"
-- get file type of item "TESTFILE" of disk "Extra1"
end tell
The first "get" reliably returns "missing value" on my machine. -- I
don't know of a reliable way to make Finder behave itself in this
instance. So I have to suggest using the "info for" command from
Standard Additions:
get file type of (info for alias "Extra1:TESTFILE")
This is a bug in Finder scripting (<rdar://problem/3312757>, assigned
to me). It probably occurs in all versions of 10.3 and 10.4.