开发者

Access command-line functions like Dashboard's "widget.system" call in a WebView?

开发者 https://www.devze.com 2023-04-04 04:04 出处:网络
I have successfully been able to use the lightly-document widg开发者_如何学Cet.system to run a \"command-line\" processes from a Dashboard widget...

I have successfully been able to use the lightly-document widg开发者_如何学Cet.system to run a "command-line" processes from a Dashboard widget...

if(window.widget) {
    if(currentlyBeingSpoken != null) {
    currentlyBeingSpoken.cancel();
    }
    currentlyBeingSpoken = \
    widget.system("/usr/bin/osascript -e 'say \
    "" + textToSpeak + "\" using \"" 
    + chosenVoice + "\"'" , done);
}

I want to "do" the same kind of thing from a Cocoa "WebView".

How can this be accomplished? Is it just a matter of finding the right part of Apple's Javascript code? Or is this a runtime implementation of the dashboard that is not accessible from a WebView?

0

精彩评论

暂无评论...
验证码 换一张
取 消