Re: Issue with files passed to subroutines
Re: Issue with files passed to subroutines
- Subject: Re: Issue with files passed to subroutines
- From: Timothy Bates <email@hidden>
- Date: Sun, 09 Sep 2001 01:05:56 +1000
On 9/9/01 12:43 AM, "Irwin Poche" <email@hidden> wrote:
>
why doesn't this work?
>
tell application "Finder"
>
set sFiles to files in selection
>
my check_file(item 1 of sFiles)
>
end tell
>
>
on check_file(the_file)
>
set itemComment to comment of the_file
>
log itemComment
>
end check_file
you have to address the finder inside your handler
on check_file(the_file)
tell application "Finder "
set itemComment to comment of the_file
log itemComment
end
end check_file
PS: One way to spot this kind of error is that key words like "comment" are
formatted as it they were user variables instead of object names: the
handler does not know about the Finder and so has no idea that the_file has
a "comment" property or what this might even mean.
tim
Dr Timothy Bates <
mailto:email@hidden>
Macquarie Centre for Cognitive Science (MACCS)
Macquarie University
Ph 61 (2) 9850 8623
Fx 61 (2) 9850 6059