• 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: Open Script Editor in OSX
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Open Script Editor in OSX


  • Subject: Re: Open Script Editor in OSX
  • From: Paul Berkowitz <email@hidden>
  • Date: Tue, 15 Mar 2005 10:03:19 -0800

On 3/15/05 9:34 AM, "Steve Foster" <email@hidden> wrote:

> I have a small but very annoying problem. I am working in Apple Studio
> and need to run an include file in Script editor. the following script
> works fine BUT it always opens the script editor in Classic (and goes
> through all of the classic opening routine) . Does anyone know a way of
> forcing the programme to open the OSX Script Editor?
>
> tell application "Script Editor"
>
> set strRunScript to run script alias strIncScript
>
> end tell


First of all, why do you have to run it in Script Editor? Why don't you just
run the script? Is this for a demo of Script Editor or something?

Do you really need to set a variable to the "result" of 'run script'?

Why use 'run script' instead of just loading the script and running it?

 set f to load script alias strIncScript
 tell f to run
 -- set  strRunScript to result  --?


Is strIncScript a text file, not a compiled script (.scpt) or applet? In
that case, OK, 'run script' is correct, but why do you need Script Editor to
run it?

    set strRunScript to run script alias strIncScript

If you really, really need OS X's Script Editor to open, then I'd do it this
way. You can put in error traps just in case someone has moved it, but who
does that?

set scriptEditorPath to (path to applications folder from local domain as
Unicode text) & "AppleScript:Script Editor.app"
tell application scriptEditorPath to activate -- or launch

That will work for English Language systems, where Script Editor is called
"Script Editor". Maybe that's true for all MacRoman, or even all Latin
alphabet systems.

A better method would usually be:

tell application "Finder"
    set scriptEditorPath to application file id "ToyS" as Unicode text
end tell
tell application scriptEditorPath to activate -- or launch

Now on my machine that returns the OS X Script Editor path. But check it on
yours - if you get the same, then this is the best method. If you get the
Classic Script Editor, then you'll have to use the other one.

But why in the world are you trying to run this script in Script Editor?

--
Paul Berkowitz


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Open Script Editor in OSX
      • From: Steve Foster <email@hidden>
References: 
 >Open Script Editor in OSX (From: Steve Foster <email@hidden>)

  • Prev by Date: Re: Open Script Editor in OSX
  • Next by Date: Re: Open Script Editor in OSX
  • Previous by thread: Re: Open Script Editor in OSX
  • Next by thread: Re: Open Script Editor in OSX
  • Index(es):
    • Date
    • Thread