• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: traversing handlers aren't returning value
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: traversing handlers aren't returning value (From: Bastiaan Boertien <email@hidden>)

  • Prev by Date: RE: Highlighting text and image channels
  • Next by Date: Re: Mount Volume With Guest Access
  • Previous by thread: Re: traversing handlers aren't returning value
  • Next by thread: Re: traversing handlers aren't returning value
  • Index(es):
    • Date
    • Thread