Re: BIZARRE File Type returned...sometimes!
Re: BIZARRE File Type returned...sometimes!
- Subject: Re: BIZARRE File Type returned...sometimes!
- From: John Stewart <email@hidden>
- Date: Tue, 29 Jun 2004 17:29:20 -0400
On 06/29/04 at +0100 Michael Tompsett said this
>
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)
>
>
>
tell application "Finder"
>
set thefolder to choose folder with prompt "Select Folder"
>
set thelist to entire contents of thefolder
>
repeat with i in (thelist as list)
>
set i to (i as string)
>
if last character of i ? ":" then
>
try
>
set thetype to file type of alias i
>
if thetype = "x?Z" then
>
display dialog "FAILED"
>
exit repeat
>
end if
>
if thetype = "XDOC" then delete file i
>
end try
>
end if --last character
>
end repeat --with i
>
end tell
You may find that this script is a bit shorter (all on 1 line)-
tell app "Finder" to delete (every file of entire contents of (choose folder with prompt "Select
Folder")) whose file type = "XDOC"
JBS
--
I thought about how mothers feed their babies with tiny little spoons and forks, so I wondered what
do Chinese mothers use? Toothpicks? - George Carlin
_______________________________________________
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.