<div>Dear Jonathan,</div>
<div> </div>
<div>Yes that QTscript is very JS like, and the extensions to the prototype model are good to, and if I read the <a href="http://doc.trolltech.com/4.0/designer-manual.html">http://doc.trolltech.com/4.0/designer-manual.html</a> information correctly it appears that QT forms can be invoked?</div>

<div> </div>
<div>And it seems that there is built in script editing support in the QTscripting framework for applications?</div>
<div> </div>
<div>I guess I am just going to have to pick up whatever scripting environment (QT Lua ...) is incorporated!<br></div>
<div>paul<br></div>
<div class="gmail_quote">2009/9/11 Jonathan Kew <span dir="ltr">&lt;<a href="mailto:jfkthame@googlemail.com">jfkthame@googlemail.com</a>&gt;</span><br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div class="im">On 10 Sep 2009, at 11:53, Stefan Löffler wrote:<br><br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">I have no experience with this kind of Qt scripting, but a preliminary<br>search of the docs tells me &quot;yes and no&quot;. If what Jonathan has in mind<br>
is indeed QtScript, it is not JavaScript, it&#39;s _like_ JavaScript. It has<br>the same syntax and the same basic functions (e.g. for string handling,<br>calculations, etc.; technically speaking it implements the ECMA-262<br>
standard), but it doesn&#39;t have all the browser/internet related<br>functions.<br></blockquote><br></div>Right, the obvious thing to do in texworks is to enable QtScript, which (as I understand it) is an implementation of ECMAScript, which is the basis for JavaScript. But naturally this will not include many specifically web-browser-related objects and functions.<br>
<br>I&#39;ve been pleasantly surprised at how well it seems to work in general, though: for example, prompted by Paul&#39;s Lua examples, I googled for a JS Title Case function (as titlecasing is a non-trivial operation, if you want to do it well); found something promising at &lt;<a href="http://individed.com/code/to-title-case/" target="_blank">http://individed.com/code/to-title-case/</a>&gt;, so I put that into a TW script, wondering if it would handle the tricky regexes, etc.... worked perfectly.<br>
<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">No window, document,<br></blockquote><br>Qt objects such as the document and window are scriptable, actually, though we may want to add setters for more properties: for example, AFAICT a script can read the window geometry (position, size) but cannot change it to arbitrary values, only call specific functions such as showMaximized (which works fine from script, I just tried). But we can trivially add things like move() and size() to allow a script more control (so you could write a custom window-arranging script, for example, to configure them to your liking). 
<div class="im"><br><br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">location and also no XMLHttpRequest<br>(which, IIRC, wasn&#39;t supported by many browsers for quite a while). So<br>
much for the bad news.<br>The good news is that it could be relatively easy to work around this.<br>Qt does support HTTP requests, and it has additional classes to handle<br>XML. So one could fabricate something similar to XMLHttpRequest().<br>
However, I&#39;m not sure if this can be done from within the script (I<br>think it would have to be done on the C++ side and then made available<br>to the script; but these are details).<br></blockquote><br></div>Right, I don&#39;t think there&#39;s any ready-made networking support, but I don&#39;t think it would be hard to add a scriptable object that can make requests and receive responses. 
<div class="im"><br><br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote"><br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">It just seems mind blowing what could be achieved. Tap directly into<br>databases .., well do anything that the server that recives the<br>
request can process.<br></blockquote><br>Just one word of caution at the end. This mechanism can be incredibly<br>dangerous. If you execute scripts that you don&#39;t trust (and many people<br>seem to do this every day), you open the gates to viruses, hackers and<br>
who knows what else. So I&#39;d discourage automatic internet requests from<br>within scripts, and in any case the user has to be informed and has to<br>be able to choose whether or not a particular request should be made.<br>
</blockquote><br></div>We&#39;ll need to label the package &quot;Handle With Care&quot;. :)<br><font color="#888888"><br>JK<br><br></font></blockquote></div><br>