CallJS sample

  • Hi everyone,

    I have been taking a look at the Javascript bridge as a way to allow users to script my Mac app. I have downloaded the CallJS sample from Apple and everything seems simple enough. However, it looks like the "Run JavaScript" button doesn't work, as the sentence [theWebView stringByEvaluatingJavaScriptFromString:[[scriptText textStorage] string]] doesn't seem to return anything.

    Any ideas on what may be wrong with the sample?

    Regards,

    Huibert Aalbers
  • On 19.05.2013, at 22:06, Huibert Aalbers <huibert...> wrote:

    > Hi everyone,
    >
    > I have been taking a look at the Javascript bridge as a way to allow users to script my Mac app. I have downloaded the CallJS sample from Apple and everything seems simple enough. However, it looks like the "Run JavaScript" button doesn't work, as the sentence [theWebView stringByEvaluatingJavaScriptFromString:[[scriptText textStorage] string]] doesn't seem to return anything.

    just tried the sample. Entering 3+4 results in 7. The "return 'Hello JavaScript!';"
    is no valid Javascript. Calling a function:

    (function() {return 'Hello JavaScript!';})()

    works though. For JavaScript-scripting: take a look at http://jstalk.org .

    Cheers,

    felix
previous month may 2013 next month
MTWTFSS
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Go to today