Re: traversing handlers aren't returning value
Re: traversing handlers aren't returning value
- Subject: Re: traversing handlers aren't returning value
- From: Eric Geoffroy <email@hidden>
- Date: Tue, 11 Jan 2005 08:09:44 -0800
Bastiaan-
I want to stop the handler as soon as it finds a match for (quark, indesign, or framemaker). If I put the "return" inside the handler loop it should stop it. It keeps running though.
thx
- Eric
On Jan 11, 2005, at 12:20 AM, Bastiaan Boertien wrote:
Hello Eric
The problem is your return inside a handler. if you use "return" in a
Handler, you stop the handler and return a value from your handler. So
your loop will not be continued.
I modifiied the script a little i made a handler at the bottom of this
script
greetings bastiaan
set the foldr to (choose folder)
set ft to ""
-- Find text folders
tell application "Finder"
set text_folders_only to folders of the foldr whose name
contains "text"
end tell
set ft to processFolders(text_folders_only, ft)
------ Handlers -----
--Process folders, no font folders. filters "fol" down
on processFolders(foldrlist, ft)
repeat with thisFolder in foldrlist
say (name of thisFolder as string)
tell application "Finder"
set fils to files of thisFolder
set fols to (folders of thisFolder whose name
does not contain "font")
end tell
if fils = {} then
say "no files in, " & (name of thisFolder as
string)
else
ProcessFiles(fils)
end if
processFolders(fols, ft)
sayIt(ft)
end repeat
end processFolders
on ProcessFiles(filesToBeProcessed)
set creetor to ""
set ft to ""
repeat with thisFile in the filesToBeProcessed
say "processing " & name of thisFile as string
set creetor to file creator of (info for file (thisFile
as string))
if creetor is "XPR3" then
set ft to "Quark 4.11, Mac"
sayIt(ft)
else if creetor is "Fm70" then
set ft to "FrameMaker 7.0, Mac"
sayIt(ft)
else if creetor contains "InDn" then
set ft to "InDesign CS, Mac"
sayIt(ft)
end if
end repeat
end ProcessFiles
on sayIt(ft)
say "result is" & ft as string
end sayIt
<ATT2484120.txt>
Eric Geoffroy
Media Producer
Peachpit Press
(510) 524-2178 x214
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden