Search the web
Sign In
New User? Sign Up
jsosa · JavaScript OSA-Talk
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Console Output in Terminal?   Message List  
Reply | Forward Message #521 of 529 |
Re: [jsosa] Re: Console Output in Terminal?

Hi,

> Being new to the mac world, I'm surprised that OSA (specifically
> javascript osa) hasn't had a HUGE impact. I'd much rather script to
> javascript than applescript.

That's probably a subject for an entire book. The OSA (Open Scripting
Architecture) predates Windows Scripting Host and was a very good idea,
though in typical Apple style of the time, over engineered.

There was at one time an effort to make Windows and the Mac OS share the OSA
standard (see OpenDoc), but that broke down for lots of reasons and MS went
their own way with Windows Scripting Host.

In the Classic Mac OS days, the OSA runtime environment imposed memory
management restrictions that made it almost impossible to host Unix derived
scripting languages so JS, Perl, Ruby, Python where never ported. These
restrictions have largely been removed under Mac OS X. However, the total
lack of documentation and the complexity of creating an OSA version of any
scripting language has prevented many other languages from being implemented
- though there have been attempts.

As for why JSOSA didn't take off there are probably lots of reasons:

- AppleScript is good enough for most folks
- users must install JSOSA before they can run scripts while AppleScript is
bundled with the OS
- Apple's less than whole hearted support for OSA (e.g. Apple's Script
Editor gets a little unstable when using anything other than AppleScript,
AppleScript Studio is AppleScript centric when it could/should be OSA
centric)
- my support/promotion of JSOSA has not been successful
- my unwillingness to make JSOSA Open Source
- more attractive alternatives (AppleEvent hooks for Perl, Python and Ruby)

> Now, if there was only a Core.ConsoleOutput("") for running a script
> in terminal, rather than echo'ing... (hint hint) :)

I've filed a bug here, and I'll get it resolved in the next maintenance
release.

Cheers
-Mark

------------------------------------------------------------------------
Mark Alldritt Late Night Software Ltd.
Phone: 250-380-1725 Script Debugger 4.0 - AppleScript IDE
WEB: http://www.latenightsw.com/ FaceSpan 4.3 - AppleScript RAD
Affrus 1.0 - Perl Debugging





Fri Jan 5, 2007 6:23 pm

malldritt2000
Offline Offline
Send Email Send Email

Forward
Message #521 of 529 |
Expand Messages Author Sort by Date

I'm running a script via terminal using: osascript -lJavaScript filename.js but I can't seem to be able to output any text to the terminal. Core.message is...
smakofsky
Offline Send Email
Jan 4, 2007
3:08 pm

Hi, ... The problem here is the osascript tool. There is a 'log' AppleEvent for this purpose, but osascript does not seem to respond to it. Testing from...
Mark Alldritt
malldritt2000
Offline Send Email
Jan 4, 2007
4:39 pm

Ah, ok..: var Test = "Hello World"; MacOS.appSelf().do_shell_script("echo " + Test); Seemed to do the trick. Would be nice to just have Core.Write() or ...
smakofsky
Offline Send Email
Jan 4, 2007
4:52 pm

Hi Steve, Instead of JSOSA, you may want to consider using a Java based JavaScript engine: For example... ...
John Love-Jensen
eljay@...
Send Email
Jan 4, 2007
6:54 pm

I initally tried rhino before I found JSOSA - but it didnt appear to be able to interact with apple events. Do you know if it can? ... JavaScript ... ...
smakofsky
Offline Send Email
Jan 5, 2007
2:43 pm

Hi, ... JavaScript OSA's ability to generate AppleEvents is its unique feature. JavaScript OSA uses the Spider Monkey (Mozilla's C JavaScript implementation)...
Mark Alldritt
malldritt2000
Offline Send Email
Jan 5, 2007
3:59 pm

Which is the *exact* reason I'd rather use JSOSA. Having apple event support is killer. Being new to the mac world, I'm surprised that OSA (specifically ...
smakofsky
Offline Send Email
Jan 5, 2007
5:14 pm

Hi, ... That's probably a subject for an entire book. The OSA (Open Scripting Architecture) predates Windows Scripting Host and was a very good idea, though...
Mark Alldritt
malldritt2000
Offline Send Email
Jan 5, 2007
6:32 pm

... I do not know. I presume it does not, given that it is Java based and runs in a JVM. (Not that running in a JVM makes it impossible to interact with AE....
John (Eljay) Love-Jen...
eljay@...
Send Email
Jan 5, 2007
3:25 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help