[texworks] Mail list and other issues

Paul A Norman paul.a.norman at gmail.com
Wed Mar 13 08:34:47 CET 2019

Hi Iggor,

I can help you with 2. finding the current file directory.

I have a Script for TeXworks I often use :-)
See if it helps or what you need - lets know...

Use the TeXworks menu for Scripts/Scripting TeXworks, ask it to "Show
Scripts Folder"

Then place the following in a plain text file in there called something
like "openContainingDirectory.js"

Then in the Scripts Menu - use Scripting TeXworks, ask it to "Reload

Next time you use your Scripts Menu you should see an item - " Open
containing directory"
Use it from within the TeXworks document you want to open.

(The following Script could be modified to just only show the path on the
status panel at the bottom of TeXworks as well perhaps.)

I hope this helps,
kind regards,


// TeXworksScript
// Title: Open containing directory
// Description: Opens the directory containing the current file in the
default file browser
// Author: Stefan Löffler & Jonathan Kew
// Version: 0.1.1
// Date: 2011-07-26
// Script-Type: standalone
// Shortcut: Alt+O, Alt+C, Alt+D

  eval(TW.app.getGlobal("helper_twPan")); //  Comment if NOT Needed - This
includes PhpJs ($P), twConst, msgBox, twPan ($tw), string.toTitleCase()

function basename(str) {
    var base;

    base = str.replace(/\/[^\/]*$/, "");

    if(base == "") {
        if(TW.platform() == "Windows") // should never happen; there should
always be <letter>: left
            base = "C:/"
            base = "/";

    if(TW.platform() == "Windows") // Windows 8.1 wants backslashes in
*some* system calls
            base = base.replace(/\//g,"\\");

    return base;

// WIndows 81 has broken this... TeXworks needs to be "Run as Administrator"

  //TW.launchFile( TW.target.fileName );
  var thisDirectory = basename(TW.target.fileName);
 // thisDirectory =TW.target.fileName;

  cmd = "%windir%\\explorer.exe /E,\"" +  thisDirectory + "\"";

  twPan.file_put_contents( thisDirectory + "\\open.bat", cmd);

  twPan.osCmd("cmd /c \""+  thisDirectory  +"\\open.bat\"", true);

  TW.app.clipboard = cmd;


On Wed, 13 Mar 2019 at 03:22, Iggor Ya. D. <iggor at sci.lebedev.ru> wrote:

> Hello!
> I work for some time with Texworks under Windows (primarily Win7 32).
> Now I have the newest version:
> TeXworks-win-setup-0.6.2-201704300708-git_7ecce17.exe
> While working I have encountered some issues with the program:
> 1. Automated mailing form the Texworks to the mail list don't work:
> mailto:texworks at tug.org?... etc  - failed due to unknown reason. Mail
> agent was setup and mailto works from Firefox (but not from command
> prompt, of course).
> 2. Very annoying issue:  while working with different versions of the
> same text it is almost impossible to figure out what version is opened
> (in which directory lays the current file). The only method is to try
> to save the file, but it is not so good and the user can rewrite the
> file unwillingly.
> Is there any ways to make available solution?
> --
> С уважением,
>  Iggor                          mailto:iggor at sci.lebedev.ru
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/texworks/attachments/20190313/8c8278fc/attachment.html>

More information about the texworks mailing list