[texworks] SCRIPTING: Happy New Year to ALL! - openFileFromScript

Stefan Löffler st.loeffler at gmail.com
Tue Jan 4 07:37:19 CET 2011


On 2011-01-04 07:22, Paul A Norman wrote:
> I should have dug more deeply, I mistook the error message  ...
>   " argument 2 has unknown type `TWScriptAPI*' "
> ... to mean that the actual call was looking in .cpp for an unkown
> type not established in Qt yet.

Well, almost, but not quite. It tells you that scripting doesn't know
how to handle TWScriptApi*, in this particular case how to convert the
scripting value null to such an object. In fact, I'm not totally sure
why it did work when passing a TWScriptApi* object in the first place,
but it did. Anyway, this should be fixed now.

> Duh - TW ok!   and TW.script - well I might not have got there :)

TW.script should not work. Only TW should. (oh, well, since r727 you
could pass TW.script as well, but the result would be the same as if you
had passed null). What I tried to explain was that right now, only the
script object is evaluated when you pass TW, but as this might change in
the future and TW is shorter to write than TW.script, I went with the
simple solution.


More information about the texworks mailing list