Re: conditional error
Re: conditional error
- Subject: Re: conditional error
- From: monk <email@hidden>
- Date: Sun, 22 Jul 2001 12:27:37 -0400
-- 7/22/01 09:42 am: email@hidden said:
>
You should write this:
>
>
Set theReply to dialog "process by:" buttons {"word", "line","paragraph"}
>
default button "word"
>
if button returned of theReply is "word" then
>
set _listsource to (read _source as text using delimiter {return, space})
>
else if button returned of theReply is "line" then
>
set _listsource to (read _source as text using delimiter {return})
>
else
>
set _listsource to (read _source as text using delimiter {space})
>
end if
>
>
The second condition had no way of know what the button returned was part
>
of. It does not have the value from the first condition.
>
>
> From: monk <email@hidden>
>
> Date: Sun, 22 Jul 2001 04:50:43 -0400
>
> To: "applescript users (apple)" <email@hidden>
>
> Subject: conditional error
>
>
>
> when i run this, the first 'if' compiles fine, but the second and third give
>
> me an error that 'can't make some data into expected type'
>
> --
>
>
>
> if button returned of (display dialog "process by:" buttons {"word", "line",
>
> "paragraph"} default button "word") is "word" then
>
>
>
> set _listsource to (read _source as text using delimiter {return,
>
> space})
>
>
>
> else if button returned is "line" then
>
>
>
> set _listsource to (read _source as text using delimiter {return})
>
>
>
> else
>
>
>
> set _listsource to (read _source as text using delimiter {space})
>
>
>
> end if
>
thanks!
h 'monk' elmer
--
//\/\\/\/\//\/\\/\/\//\/\\
http://www.assemblage.org