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

Paul A Norman paul.a.norman at gmail.com
Tue Jan 4 08:33:39 CET 2011


On 4 January 2011 19:37, Stefan Löffler <st.loeffler at gmail.com> wrote:
> Hi,
>
> 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,

Thanks for that I was a little unsure how that was casting or what was
happening but as you say it does work.

> 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.
>
Ah thanks for that.

> HTH
> Stefan
>



More information about the texworks mailing list