Re: Handler works only once
Re: Handler works only once
- Subject: Re: Handler works only once
- From: Kai <email@hidden>
- Date: Fri, 21 Feb 2003 05:50:59 +0000
on Thu, 20 Feb 2003 17:21:41 +0000, has <email@hidden> wrote:
>
Rich Carroll wrote:
>
>
>I seem to be having a problem with a handler working only the first time
>
>thru. If I call it again, I get "Finder got an error: Can't continue
>
>wrangleName" (handler name) error.
[snip... explanation of problem]
>
p.s. The code you posted was pretty convoluted. Below is a cleaner
>
version which you're welcome to use. (It also does error handling and
>
recording, which avoids it stalling on problem names.)
>
>
======================================================================
Dang! I was just about to post a reply when I saw you'd beaten me to it,
has! My own suggestion doesn't include traps, but I'm posting it anyway -
mainly because I've done it now! :-D
======================================================
property goodText : ".0123456789ABCDEFGHIJKL[NO-BREAK]
MNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz"
to checkFolder(x)
tell application "Finder" to [NO-BREAK]
set {fList, dList} to x's {folders, document files}
repeat with f in fList
checkFolder(f)
end repeat
repeat with d in dList
checkName(d)
end repeat
checkName(x)
end checkFolder
to checkName(i)
set n to ""
tell application "Finder" to set o to i's name
repeat with c in o
if c is in goodText then set n to n & c
end repeat
if n is not o then tell application "Finder" to set i's name to n
end checkName
checkFolder(choose folder with prompt "Select folder to be checked.")
======================================================
--
Kai
_______________________________________________
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.