[texworks] SCRIPTING: global __FILE__ now only available when debugger on?

Paul A Norman paul.a.norman at gmail.com
Mon Dec 12 00:44:43 CET 2011

Awesome thanks Stefan, I'll write that into the Scripting api.

Actually in one dialogue box I have been making for inserting images
into .tex docs, I actually have been showing the version number of the
script in the dialogue so that people would be able to see whether
they need to upgrade or not - so far I have had to read the script
itself into memory and search for the string.

So "for the sake of completeness" - the completeness principle proves
itself again.


On 12 December 2011 00:01, Stefan Löffler <st.loeffler at gmail.com> wrote:
> Hi,
> On 2011-11-20 09:57, Paul A Norman wrote:
>> Seems any script locating the script's directory through __FILE__ no
>> longer works when the Debugger is off (eg .ui(s)). I don;t know when
>> this started but I am reasonably sure I have not had this happen at
>> all before now. I can not say what version of TW I last successfully
>> ran __FILE__ with Debugger off I am sorry.
>> Is this a new Qt  4.7.3  feature (hmm), or something I should put on
>> Tw issues?
> I assume it's a Qt-related thing. In r952, I added a couple of
> properties to deal with that. The new properties are (as visible in
> scripts):
> TW.script.fileName
> TW.script.title
> TW.script.description
> TW.script.author
> TW.script.version
> Probably only fileName is of any real interest (as the others are
> defined exclusively by the script author), but I thought I'd include the
> rest for the sake of completeness, too.
> Stefan

More information about the texworks mailing list