• JavaScript in Mac softwar

    From Nightfox@DIGDIST/BATTLEST/FREEWAY to All on Thu May 14 18:37:00 2015
    Recently I've been doing some Mac test app development at work, and I wanted to make a scriptable test app to enable automated testing. Today I realized that it's very easy to make use of a JavaScript engine (WebKit, to be exact) in Objective-C or Swift and start writing code blocks that can be called from JavaScript. It seems Apple's XCode already includes the libraries and headers for embedding JavaScript, making it really easy: http://hayageek.com/execute-javascript-in-ios/ http://nshipster.com/javascriptcore/

    I had done the same a couple years ago in Windows, where I made one of our test apps scriptable by using the Mozilla JavaScript engine. It was more of a hassle in Windows though - More steps were involved, since Microsoft's Visual Studio doesn't include a JavaScript engine. I had to build the Mozilla JavaScript engine, then add its library to my Visual Studio project configuration to link against it, before including the JavaScript engine headers and setting up the functions to be called from JavaScript. I suppose in all it wasn't too bad, just more steps compared to doing it with XCode in OS X.

    I think it's pretty cool that scripting engines are available to be embedded in software to make them scriptable. It's great for software testing and other situations where you might want to enable scripting so you don't have to rebuild the software. I've seen apps scripted with Python too - I wouldn't mind trying that some time.


    Synchronet Digital Distortion: digitaldistortionbbs.com