[texworks] SCRIPTING: 1. __FILE__ not quite true and 2. TW.system not handling - or _ in path structure(?)

Paul A Norman paul.a.norman at gmail.com
Thu May 19 04:03:25 CEST 2011


Hi,

Some unexpected results ...

 TW.information(null, "", __FILE__);

Shows the path and file name - but the first segment between the first
delimeter / / set  is set to lowercase and I have some capitals there.

E.g.

Real path is:

G:/LaTeXPortable/LaTexUtils/TeXWorks/texworks/config/scripts/Image
Handling/convertImage.js

But __FILE__ copies to clipboard in Script as:

G:/latexportable/LaTexUtils/TeXWorks/texworks/config/scripts/Image
Handling/convertImage.js

All the other capitals are ok.

Also, If I change this part of the path  /Image Handling/  to either
of   /Image-Handling/  /Image_Handling/

I get strange results when I try to pass this through TW.system even
just for:  cmd /c dir /b \" + scriptPath + "\\*.txt\""

"Parameter format not correct - "latexportable"."

The above works fine when it is /Image Handling/ in the path (with the space).

And copying cmd /c dir /b \" + scriptPath + "\\*.txt\"" in expanded
form to the clipboard in script and then pasting it into a dos prompt
works fine for all three path versions of   /Image Handling/
/Image-Handling/  /Image_Handling/

Any thoughts appreciated please,

Paul


More information about the texworks mailing list