Re: Format of strings when using run script
Re: Format of strings when using run script
- Subject: Re: Format of strings when using run script
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 19 May 2003 23:40:41 -0700
On 5/19/03 11:03 PM, "Jaime Magiera" <email@hidden> wrote:
>
It's unclear to me why a straight string will not compile into a
>
script. For example...
Is it really? I guess you just learned that line endings are part of a
script's syntax.
>
>
set scriptObj to run script "
>
script
>
set helloString to \"Hello world\"
>
display dialog helloString
>
end script"
>
>
returns +script;
>
>
However,
>
>
set scriptObj to run script "script set helloString to \"Hello world\"
>
display dialog helloString end script"
>
>
returns script error
>
>
I'm trying to create strings on the fly that can be compiled into
>
scripts and saved to disk. However, the above problem is a big
>
hindrance. Any ideas?
set scriptObj to run script "script" & return & "set helloString to \"Hello
world\"" & return & "display dialog helloString" & return & "end script"
--or (all one line)
set scriptObj to run script "script\rset helloString to \"Hello
world\"\rdisplay dialog helloString\rend script"
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.