• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Format of strings when using run script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Format of strings when using run script -- ok, next step
      • From: Jaime Magiera <email@hidden>
References: 
 >Format of strings when using run script (From: Jaime Magiera <email@hidden>)

  • Prev by Date: Re: Format of strings when using run script - fixed
  • Next by Date: Re: Format of strings when using run script -- ok, next step
  • Previous by thread: Re: Format of strings when using run script - fixed
  • Next by thread: Re: Format of strings when using run script -- ok, next step
  • Index(es):
    • Date
    • Thread