On Aug 20, 2013, at 11:05 AM, willray <
wil...@mac.com> wrote:
> Ahh - I thought I remembered you saying something about integrating it directly, somewhere along the line, but google and I couldn't find any evidence to substantiate my foggy memory, so I thought I'd better ask. (and as an aside, why compile it in directly, rather than provide some flexibility as a dynamic Framework? -- or is that due to the iOS issue with non-Apple frameworks?)
It was easier to debug when compiling it directly in.
> I'm not sure I understand your VPJSPrefixScript suggestion. The modified alert method needs access to Objective-C/Cocoa/Applescript method arguments that the default JSTalk doesn't expose. Is there a way to monkey-patch JSTalk directly at the on-page scripting level that I've been missing?
Make a page named “VPJSPrefixScript”, then paste this in:
function displayDialog(msg, title, oktxt, noktxt) {
var alert = [NSAlert alertWithMessageText:title defaultButton:oktxt alternateButton:noktxt otherButton:nil informativeTextWithFormat:msg];
return [alert runModal];
}
Then you can call:
result = displayDialog("Hello, World", "Title", "OK", "BAD");
From any of your scripts and get the same thing your patch provides. Or you can just use NSAlert directly.
-gus