[texworks] SCRIPTING: TWapi getOpenFileName(filter string)
Paul A Norman
paul.a.norman at gmail.com
Sun Dec 12 23:58:20 CET 2010
Thanks that was my next question ";;" very useful feature when its ready.
On 13 December 2010 04:51, Stefan Löffler <st.loeffler at gmail.com> wrote:
> On 2010-12-12 07:01, Paul A Norman wrote:
>> Ok, working api usage and documentation for TW.app.getOpenFileName(),
>> Say I am building a function to insert a graphic name.
>> ... shows an overload function that can recieve a string that would be
>> prepended as a file filter to the Tw standard filter list
>> Filters in
>> ... suggests that I can construct my filter to look like this:
>> "Image Files (*.jpg *.png *.pdf)"
>> So then experimentally this works nicely ...
>> TW.information(null,"Choose Image",TW.app.getOpenFileName("Image
>> Files (*.jpg *.png *.pdf)"));
>> Is my construction for the filter string correct and stable please?
> Yes. The filter string is passed to QFileDialog::getOpenFileName, so its
> format is documented by Qt (e.g.,
> Note that I would not recommend using ";;" in your string (i.e., to add
> more than one filter to the dialog). While this should work in most
> cases at the moment, it is not handled properly and may change in the
More information about the texworks