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?
精彩评论