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

Paul A Norman paul.a.norman at gmail.com
Sat Jan 1 06:41:43 CET 2011

Happy New Year to ALL!

Working through writing up Scirting Api and wondering about this please,

Can't yet test openFileFromScript() (thanks for putting that in Stefan)

Debugger says ...

"Uncaught exception at
- Experiments/tw_OBJECT.js:19: TypeError: cannot call
openFileFromScript(): argument 2 has unknown type `TWScriptAPI*'
(register the type with qScriptRegisterMetaType())
19	var   ret =  TW.app.openFileFromScript('c:/hold/MyFile.txt', null,
-1, true);"

Tried second argument with various, however can see that it is
complaining that something is not set/registered in Scripting engine?
Would this argument effectively disappear from User's scope if already
registered? and then the following be renumbered back one?

3rd argument desired cursor position?

4th argument whether to prompt user if file read permission not set to
True in Preferences?


More information about the texworks mailing list