I have read the below page, and the linked pages at JXA Cookbook, about 3 times now. They refer to each other in a never-ending circle.
Access JXA App Instance and shims for alert, prompt and confirm
This page send me to:
which sends me to:
which is a very confusing page referring to lots of stuff.
At this point, my head is spinning.
Maybe I’m just stupid, but I really have read all of this stuff at least 3 times, and it’s not clear where to start, and exactly what steps are needed.
I need clear, step-by-step instructions, not just for me, but for other users (who are not JXA coders) that I will send my JXA scripts to. There is no way a non-tech, non-programmer user could understand what to do.
Ultimately, I would like to include other libraries in my JXA scripts, like JQuery and JQuery UI. But I need setup instructions for the end user.
Can anyone help?
Application() object from inside Node.js code.
From Script Editor you get a direct reference anyway with lines like:
var a = Application.currentApplication;
var appSafari = Application("Safari").
If for some reason you do want to write and run Node.js code, and call Node.js modules, you will first need to install Node.js
Once you have done that, you will be able to use
npm install <NodeJS_ModuleName> from a Bash prompt in Terminal.app
Perhaps that is really what you want to do ? Your reference to 'the' JXApp makes me wonder whether a confusion has perhaps arisen – that page of the CookBook probably does assume a Node.js-using audience, and could be a bit opaque to more general readers.
Also, it looks as if there's a dangling link there, following an edit to the CookBook wiki – the link from the npm module page should really be to the discussion of exotic interactions and library-calling gymnastics here:
Well, remember that JQuery is a web engine library – it presents a richer and browser-independent interface to the web page DOM.
No, I’m not.
Thanks for responding, Rob.
Here’s what I want to accomplish. Perhaps you can suggest the best approach to do so.
- IOW, use `alert()` directly without having to use `someLib.alert()`
- Ultimately I would like to use the JQuery UI lib for stuff like the autocomplete() functions.
- I’m also anticipating that there are other JS libs, like JQuery, that I might like to use in the future
- I’m not exactly sure what the “jxapp” is, but somewhere I thought I read that it would provide access to a lot of other useful functions. But I can’t seem to find that page now.
Any guidance is greatly appreciated.
Yes, exactly. I have a number of ideas for automating Evernote (the EN Mac app) that involve:
- Highly customized web clipping (beyond what the EN Clippers does now).
- Offering the user (including me), the cool autosuggest/autocomlete of Notebooks and Tags that is in the EN Web clipper (no API is provided for this).
- Building some nice HTML forms for the above tasks
Rob, here are some statements on the JXA Cookbook that intrigue me:
From this page: Importing Scripts
Using Browserify, you can bundle a Node.js script with all their dependencies to run on a JXA environment.
Let’s Do It
OK, Browserify may well be what you want then : - )