Voodoopad 5 - where does JSTalk live?

58 views
Skip to first unread message

willray

unread,
Aug 20, 2013, 11:52:21 AM8/20/13
to jstal...@googlegroups.com

Greetings again Gus,

Different question today -- where does JSTalk live in Voodoopad 5?

In 4.*, the JSTalk.vpplugin landed in ./Contents/Plugins/, but while VP5 clearly keeps the JSTalk functionality, and JSTalk still appears in the Plugins menu, it doesn't appear to be coming from the Plugins directory.

I'm trying to find it so that I can replace it with my JSTalk version with upgraded modal dialogs...

Will

Gus Mueller

unread,
Aug 20, 2013, 1:13:31 PM8/20/13
to jstal...@googlegroups.com
On Aug 20, 2013, at 8:52 AM, willray <wil...@mac.com> wrote:

> Different question today -- where does JSTalk live in Voodoopad 5?
>
> In 4.*, the JSTalk.vpplugin landed in ./Contents/Plugins/, but while VP5 clearly keeps the JSTalk functionality, and JSTalk still appears in the Plugins menu, it doesn't appear to be coming from the Plugins directory.
>
> I'm trying to find it so that I can replace it with my JSTalk version with upgraded modal dialogs…

It’s compiled directly into VoodooPad now, so you can’t replace it. Until the patched version of JSTalk makes its way into VP, it’d probably be easiest to just put your alert box into a method that you can call easily (such as in the VPJSPrefixScript page).

-gus

willray

unread,
Aug 20, 2013, 2:05:54 PM8/20/13
to jstal...@googlegroups.com
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?)


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?

Gus Mueller

unread,
Aug 20, 2013, 4:02:25 PM8/20/13
to jstal...@googlegroups.com
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

willray

unread,
Aug 20, 2013, 4:33:09 PM8/20/13
to jstal...@googlegroups.com
...

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");
...

i was completely unaware of that route to happiness.  Thank you so much - that'll get me moving again nicely!

Will
 
Reply all
Reply to author
Forward
0 new messages