[texworks] Lua Extension - put into Sentance Case, Trim, Date Time, lowercase, uppercase

Paul A Norman paul.a.norman at gmail.com
Thu Sep 10 23:46:41 CEST 2009


Thanks Stefan,

I think we are in different time zones! I'm GMT + 12.

I am ignorant! and dont know anything about how "QT Script" would be bound
to TW, and have to admit that I thought it would be stringently gated with
access strictly proscribed. I am envisaging only text substitution in the
editor, no binary return packets accepted, and no provsision for any further
executioin in "QT Script" on the returned packet.

I "assume" that's also what Lua does with
http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/  aqnd the like,
unless you leave the door open the response is strictly channelled? Well, it
should be!

Paul

2009/9/10 Stefan Löffler <st.loeffler at gmail.com>

> Hi,
>
> Paul A Norman schrieb:
> > Dear Jonathan,
>
> Again not Jonathan, but anyway ;).
>
> > I have been thinking more about these sorts of things, and the
> > usefulness of other environments and the COM and related technmologies
> > MS do, and I was starting to think of  cross platform solutions and
> > then the
> > whole XMLHttpRequest() mechanism came ot mind
> >
> > Is it at all possible to have that kind of thing, where a port number,
> > IP and filename request can be issued and the cleaned up response text
> > applied to the selection in the Editor?  Would JavaScript in TW have
> > an XMLHttpRequest() type of object available?
>
> I have no experience with this kind of Qt scripting, but a preliminary
> search of the docs tells me "yes and no". If what Jonathan has in mind
> is indeed QtScript, it is not JavaScript, it's _like_ JavaScript. It has
> the same syntax and the same basic functions (e.g. for string handling,
> calculations, etc.; technically speaking it implements the ECMA-262
> standard), but it doesn't have all the browser/internet related
> functions. No window, document, location and also no XMLHttpRequest
> (which, IIRC, wasn't supported by many browsers for quite a while). So
> much for the bad news.
> The good news is that it could be relatively easy to work around this.
> Qt does support HTTP requests, and it has additional classes to handle
> XML. So one could fabricate something similar to XMLHttpRequest().
> However, I'm not sure if this can be done from within the script (I
> think it would have to be done on the C++ side and then made available
> to the script; but these are details).
>
> > It just seems mind blowing what could be achieved. Tap directly into
> > databases .., well do anything that the server that recives the
> > request can process.
>
> Just one word of caution at the end. This mechanism can be incredibly
> dangerous. If you execute scripts that you don't trust (and many people
> seem to do this every day), you open the gates to viruses, hackers and
> who knows what else. So I'd discourage automatic internet requests from
> within scripts, and in any case the user has to be informed and has to
> be able to choose whether or not a particular request should be made.
>
> Stefan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texworks/attachments/20090911/afdd7af6/attachment-0001.html>


More information about the texworks mailing list