Re: Handlers
Re: Handlers
- Subject: Re: Handlers
- From: Paul Berkowitz <email@hidden>
- Date: Sat, 28 Apr 2001 04:38:11 -0700
On 4/28/01 4:17 AM, "Robert Poland" <email@hidden> wrote:
>
As usual when the big Handler discussion was going on I didn't have a
>
use for it - now I have a problem. When the handler is called it acts
>
as if it isn't, it just goes on by. I have looked in "The TAO of
>
ASpplescript", "Applescript Handbook" and on the web. I think I'm
>
doing as the examples seem to show.
>
>
Example, in part;
>
>
tell application "Finder"
>
if not (folder "name of disk" of disk "Ram Disk" exists) then
>
My creatIt --or just creatIt
>
end if
>
>
on creatIt ()
>
beep 4
>
-- create file
>
end createIt
>
If you are in a tell block, such as the Finder, you _do_ need the 'my' when
calling a handler. But you also need the following parentheses. The lack of
them is why it's not working. You also need 'end tell', of course, but you
probably know that.
tell application "Finder"
if not (folder "name of disk" of disk "Ram Disk" exists) then
my creatIt()
end if
end tell
[I hope you're not trying to give a folder on a disk the same name as the
disk? Or are you trying to see if the actual RAM disk is mounted? I've not
worked with RAM disks, but it seems an odd way to go about it.]
--
Paul Berkowitz
References: | |
| >Handlers (From: Robert Poland <email@hidden>) |