[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Value returned of a script



hello, 

try:

--begin applescript
tell application "MacPerl"
    Do Script ¬
        "#!perl
    $s = 'hello';
    MacPerl::Reply($s);"
end tell

display dialog the result
--end applescript

--> hello

BTW, you do not need to use double quotes unless you have a variable
contained within the qoutes, or a backslashed character, like \n, \t, etc.

on 12/31/99 1:28 PM, John Delacour at JD@EREMITA.demon.co.uk wrote:

> There must be a ridiculously simple answer to this.
> 
> I want to get the result of a MacPerl script using Apple Events.  The only way
> I have succeeded is by sending an event to close the window "MacPerl", another
> to tell MacPerl to print the result and a third to get the text of the window,
> as in the script below.  What I want to be able to do is 'set x to (do script
> theScript)' and have the result put into x.
> 
> tell app "MacPerl"
> try
> Close Window "MacPerl"
> on error
> end try
> Do Script ¬
> "#!perl
> $s = \"hello\";
> print $s"
> set s to Text of Window "MacPerl"
> end tell
> 
> 
> JD
> 
> 

-- 
Enrique Terrazas, MD
<mailto:terrazas@labmed.ucsf.edu>
<http://pangloss.ucsf.edu/~terrazas/>


# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org