Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Is Script Editor scriptable at all?

Is Script Editor scriptable at all?
Thread Tools
AJM
Junior Member
Join Date: May 2001
Status: Offline
Reply With Quote
Jun 26, 2002, 01:44 PM
 
Hi,
is Script Editor scriptable?
What I am trying to do is to use the ScriptMenu to launch all my programs.
I made scripts like:

tell application "Blah"
activate
end tell

which I save in my Library/Scripts folder and then use to launch Blah.
It works for most of the applications, but not the Script Editor itself.
What is the problem?
Thanks,
AJM
     
Junior Member
Join Date: Apr 2000
Location: San Francisco, CA
Status: Offline
Reply With Quote
Jun 26, 2002, 03:23 PM
 
</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">quote:</font><hr /><font size="1" face="Geneva, Verdana, Arial, sans-serif">Originally posted by AJM:
<strong>Hi,
is Script Editor scriptable?
What I am trying to do is to use the ScriptMenu to launch all my programs.
I made scripts like:

tell application "Blah"
activate
end tell

which I save in my Library/Scripts folder and then use to launch Blah.
It works for most of the applications, but not the Script Editor itself.
What is the problem?
Thanks,
AJM</strong></font><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">I don't know the direct answer to your question, but do know a work around:

tell application "Finder" to open {"/path/to/ScriptEditor" as alias}

You might not need the braces {} . . . that ends up being application specific.
--
Michael F. Kamprath
     
AJM  (op)
Junior Member
Join Date: May 2001
Status: Offline
Reply With Quote
Jun 26, 2002, 04:14 PM
 
</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">quote:</font><hr /><font size="1" face="Geneva, Verdana, Arial, sans-serif">Originally posted by kamprath:
<strong>
I don't know the direct answer to your question, but do know a work around:

tell application "Finder" to open {"/path/to/ScriptEditor" as alias}

You might not need the braces {} . . . that ends up being application specific.</strong></font><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">Thanks for the suggestion. But apparently this works well for a document. For an application, it tells me it doesn't know what applications to open it with. So I tried:

tell application "Finder"
open application "Calculator"
end tell

It launches Calculator, but then it stops saying "Calculator got an error: can't continue open"
Any ideas?
Thanks again
AJM
     
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Jun 26, 2002, 04:28 PM
 
</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">quote:</font><hr /><font size="1" face="Geneva, Verdana, Arial, sans-serif">Originally posted by AJM:
<strong> </font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">quote:</font><hr /><font size="1" face="Geneva, Verdana, Arial, sans-serif">Originally posted by kamprath:
<strong>
I don't know the direct answer to your question, but do know a work around:

tell application "Finder" to open {"/path/to/ScriptEditor" as alias}

You might not need the braces {} . . . that ends up being application specific.</strong></font><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">Thanks for the suggestion. But apparently this works well for a document. For an application, it tells me it doesn't know what applications to open it with. So I tried:

tell application "Finder"
open application "Calculator"
end tell

It launches Calculator, but then it stops saying "Calculator got an error: can't continue open"
Any ideas?
Thanks again
AJM</strong></font><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">Have you tried...

tell application "Script Editor" to launch

or

[b]tell application "Finder" to launch application "Script Editor"

And if all else fails, I know this will work.. it's just not a very elegant and might also be a tad bit slower.. or faster. You never know:

do shell script "open /Applications/AppleScript/Script Editor"

Or whatever the path is...

HTH
     
AJM  (op)
Junior Member
Join Date: May 2001
Status: Offline
Reply With Quote
Jun 26, 2002, 04:57 PM
 
Thanks Synotic,
your last suggestion worked (but you have to add ".app" at the end and use "\\ " for any space in the path).
The first two work for other applications, but not the Script Editor.
Wonder why...
Anyway, it is fast enough.
Thanks again,
Aldo
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:40 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2