Re: Handler joy
Re: Handler joy
- Subject: Re: Handler joy
- From: Bill Briggs <email@hidden>
- Date: Tue, 27 Feb 2001 19:43:47 -0400
At 5:19 PM -0600 27/02/01, Jolly Roger wrote:
on 2/27/01 4:56 PM, Jeff Davison (email@hidden) wrote:
Why am I having this problem?
if I run this line outside of the handler
get the number of items of ProcessedFolder
(where ProcessedFolder is the alias "Hard Disk:Desktop Folder:Test
II:Masters:Processed:")
everything works fine and it returns the # of items inside the Processed
folder. Even if there is nothing in the folder (what I want) But if I simply
place this line inside a handler and send it the ProcessedFolder alias like
this...
on CheckProcessed (pFolder)
get the number of items of pFolder
end CheckProcessed
It gives me an error "Can't get every item of alias "Hard Disk:Desktop
Folder:Test II:Masters:Processed:"
???
What am I missing?
Not sure. This works fine for me:
-- begin script
property ProcessedFolder : "Mac HD:"
return my CheckProcessed(ProcessedFolder)
-- get the number of items of ProcessedFolder
on CheckProcessed(pFolder)
get the number of items of pFolder
end CheckProcessed
-- end script
That's not the same script. He had set the variable to an alias. If
you run this, it won't work.
-- begin script
property ProcessedFolder : alias "
Data:"
return my CheckProcessed(ProcessedFolder)
-- get the number of items of ProcessedFolder
on CheckProcessed(pFolder)
get the number of items of pFolder
end CheckProcessed
-- end script
If you do it your way it will work (but it's not the same reference
form), or wrap the above in a Finder Tell block, then it works. As
here...
-- begin script
property ProcessedFolder : alias "
Data:"
return my CheckProcessed(ProcessedFolder)
-- get the number of items of ProcessedFolder
on CheckProcessed(pFolder)
tell application "Finder"
get the number of items of pFolder
end tell
end CheckProcessed
-- end script