Re: BIZARRE File Type returned...sometimes!
Re: BIZARRE File Type returned...sometimes!
- Subject: Re: BIZARRE File Type returned...sometimes!
- From: Zachary Smestad <email@hidden>
- Date: Wed, 30 Jun 2004 14:52:18 -0500
On Jun 29, 2004, at 10:13 AM, Michael Tompsett wrote:
I m running this script to search through folders and delete quark
files.
Sometimes it works, sometimes it doesn't. It falls down when all FILE
TYPEs are wrongly reported as being: "x?Z" rather "XDOC" or "ESPF" or
whatever file type they really are.
Sometimes this change takes place halfway though the running of the
script (hence the warning if it fails)!
Anyway the script is below. Any idea why this is happening? Many Thanks
OSX 10.3.4, AS 1.9.3, Script Editor 2.0 (v43)
[snip]
We have just recently seen this issue too. Unfortunately, we were
trying to delete files that didn't have a "XPR3" creator, so the Quark
files would be identified as "?r" and be deleted. It's a good thing
the files could be recreated fairly easily.
This issue occurs:
- In 10.3.x. I've tried it on a few 10.2.8 machines and everything
worked correctly.
- On file servers. It's failed on both Windows and OS X servers, but
not from the local hard disk.
- When there are quite a few files in the folder. I've tested it mostly
in folders with > 300 files of the same type.
- Regardless of file type. I've tested with a folder full of EPSes and
this still happened.
I think it's a bug in the Finder with how it interacts with a server.
Here's a script I was using to test:
tell application "Finder"
set theFiles to every file of folder
pathToFolderWithLotsOfQuarkDocsInIt
set infoList to {}
repeat with theFile in theFiles
set navn to name of theFile
set creator to creator type of theFile
set the end of infoList to {navn, creator}
end repeat
end tell
return infoList
Run it once, all of the file types are garbled. The second time
through, they are fine. I've learned to use AppleScript only for things
that can not be done elsewhere.
Here is my replacement (all on one line) that seems to work well
(requires Developer Tools):
set creator to characters 2 thru -2 of (do shell script
"/Developer/Tools/getfileinfo -c " & quoted form of POSIX path of
(theFile as string)) as string
Zach Smestad
Tech Support Specialist
Carlson Craft Business Solutions
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.