Re: run script
Re: run script
- Subject: Re: run script
- From: has <email@hidden>
- Date: Fri, 26 Oct 2001 13:53:15 +0100
Bob Kalbaugh wrote:
>
> The following script allows you to type in one or more lines of script by
>
> using semi-colons to indicate returns (since you can't use returns in the
>
> dialog), eg:
>
>
(SNIP)
>
>
> has
>
>
>
Ahh, but you can use returns in a dialog box. You just need to use the enter
>
key to dismiss the box, or of course click the button. example:
(snip)
Hi Bob
That's a neat trick(/feature/bug?). Revised version of script below.
has
======================================================================
property yourDelim : ";" --character used to break statements
set r to return
set rr to (r & r)
set rrr to (rr & rr & rr)
try
set Dialogue_2 to display dialog "Type formula" default answer
[NO-BREAK](rrr & rr)
--trap error if user clicks "Cancel"
on error errorMsg
error errorMsg
end try
set Formula to text returned of Dialogue_2
try
set total to (run script Formula)
--trap any errors in processing script
on error errorMsg
error errorMsg & return & return & Formula
end try
display dialog total buttons {"OK"} default button 1
======================================================================
[formatted using ScriptToEmail - less than 3 proud users to date:p]
[
http://files.macscripter.net/ScriptBuilders/ScriptTools/ScriptToEmail.hqx]