• 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: Script Editor vs command line = different results
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script Editor vs command line = different results


  • Subject: Re: Script Editor vs command line = different results
  • From: Paul Berkowitz <email@hidden>
  • Date: Thu, 08 Jul 2004 16:44:11 -0700

On 7/8/04 4:21 PM, "Andersen Studley" <email@hidden> wrote:

> This code yields a "Can't make xxx into a file" error, no matter how I
> save the script
>
> set theScript to (load script "Users:me:Desktop:scpt:test.scpt")
> --[.app | .scptd | .applescript]
> run script theScript

1. You're trying to load a string, not a file.
2. If you're hard-coding the file-path like that, you need to begin with the
name of the disk that "Users:" is on


set theScript to (load script alias "Macintosh
HD:Users:me:Desktop:scpt:test.scpt") -- all one line
run script theScript


Note the dictionary for 'run script' says

run script script -- the script text (or an alias or file reference of a
script file) to run



So you don't even need to load it:

run script (alias "Macintosh HD:Users:me:Desktop:scpt:test.scpt")


Or you can load it and then just run it, without another scripting addition:

set theScript to (load script alias "Macintosh
HD:Users:me:Desktop:scpt:test.scpt") -- all one line
run theScript


They all work.

--
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: Script Editor vs command line = different results
      • From: Andersen Studley <email@hidden>
References: 
 >Script Editor vs command line = different results (From: Andersen Studley <email@hidden>)

  • Prev by Date: Script Editor vs command line = different results
  • Next by Date: Re: Sorting a list of Lists
  • Previous by thread: Script Editor vs command line = different results
  • Next by thread: Re: Script Editor vs command line = different results
  • Index(es):
    • Date
    • Thread