Re: Open Script Editor in OSX
Re: Open Script Editor in OSX
- Subject: Re: Open Script Editor in OSX
- From: Steve Foster <email@hidden>
- Date: Tue, 15 Mar 2005 18:05:28 +0000
It is run from script editor purely for a demonstration purpose. It
looks good on the screen as I have a quark doc updating and changing
live unlike the straight run command which does it in the background.
they both end up with the same result but one of them is more
impressive to demo! simple as that.
Will try you code in the morning, I'm off.
Thanks for your help.
steve
On 15 Mar 2005, at 18:03, Paul Berkowitz wrote:
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:
email@hidden
This email sent to email@hidden
_______________________________________________
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