• 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: Load Script Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Load Script Problem


  • Subject: Re: Load Script Problem
  • From: Christopher Stone <email@hidden>
  • Date: Sat, 14 Nov 2015 23:23:25 -0600
  • X_v_e_cd: 64a54b7ef628e982031da1e383377121
  • X_v_r_cd: 2988885977afeb638e9176d2b9b17c9f

On Nov 12, 2015, at 19:35, Stan Cleveland <email@hidden> wrote:
It occcurs to me that there is another way. It’s the old second-level evaluation “trick” to coerce a string (or text file contents) into a script object:
______________________________________________________________________

Hey Stan,

Ha!  Thanks.  I tried that earlier and apparently flubbed something.

Somewhere your software converted a quote to a “smart” quote, so your script wouldn't compile for me without some doctoring.

I suppose I need to break down and write a zap-gremlins script for Script Debugger to deal with those and non-breaking spaces (both of which have been biting me lately).

This works nicely.

-------------------------------------------------------------------------------------------
set pathToTextFile to alias ((path to downloads folder as text) & "testAS.txt")
# Extra step to make debugging easier.
set scriptText to ("script s" & return & (read pathToTextFile as «class utf8») & return & "end script" & return & "return s")
set scriptObject to run script scriptText
run scriptObject
-------------------------------------------------------------------------------------------

--
Take Care,
Chris

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Load Script Problem (From: Dave <email@hidden>)

  • Prev by Date: Re: Store Script Problem
  • Next by Date: Re: Store Script Problem
  • Previous by thread: Re: Load Script Problem
  • Next by thread: Re: Load Script Problem
  • Index(es):
    • Date
    • Thread