<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi Iggor,</div><div><br></div><div>Sorry about that I had been rushing to another commitment.</div><div><br></div><div>Here is a simple Script that should show you your containing directory.</div><div><br></div><div>Place it (as "showContainingDirectory.js") on your hard-drive as described before, and reload the TeXworks Script list as also described before.<br></div><div><br></div><div>Once the Script list is reloaded you can invoke it from within a current document by using the <br></div><div>holding down ALT key</div><div><br></div><div>tap once each of:</div><div><br></div><div>S C D keys</div><div><br></div><div>Or from the TeXworks Scripts menu itself as, "Show Containing Directory"</div><div><br></div><div>Apologies again,</div><div><br></div><div>Paul</div><div>- - - - <br></div><div><br></div><div></div><div>// TeXworksScript<br>// Title: Show Containing Directory<br>// Description: Showss the directory containing the current file in the default file browser<br>// Author: Paul A. Norman<br>// Version: 0.1.0<br>// Date: 2019-03-13<br>// Script-Type: standalone<br>// Shortcut: Alt+S, Alt+C, Alt+D<br><br> <br>function basename(str) {<br>    var base;<br><br>    base = str.replace(/\/[^\/]*$/, "");<br><br>    if(base == "") { <br>                        // should never happen; there should always be <letter>: left<br><br>        if(TW.platform() == "Windows") <br>            base = "C:/"<br>        else<br>            base = "/";<br>    }<br>    <br>    // if(TW.platform() == "Windows") // Windows 8.1 wants backslashes in *some* system calls<br>    //        base = base.replace(/\//g,"\\");<br>            <br>    return base;<br>}<br><br><br> var path = basename(TW.target.fileName);<br>   <br> TW.information(null, 'Document Path-', path);<br>  <br>  // Uncomment the following if you want to automatically copy the path to the clipboard as well ...</div><div><br></div><div> // TW.app.clipboard = path;<br>  <br> <br>  null;<br></div><div><br></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 13 Mar 2019 at 23:00, Paul A Norman <<a href="mailto:paul.a.norman@gmail.com">paul.a.norman@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>P.S.</div><div><br></div><div>I'll write you a direct script later.</div><div><br></div><div> There are a couple of prerequisites in what I sent you, that you won't want to bother with downloading and setting up (eval(TW.app.getGlobal("helper_twPan"));)</div><div><br></div><div>And eventually you will need to check your Scripting Security settings under...</div><div><br></div><div>Edit/ Preferences / Scripts <br></div><div><br></div><div>May need most boxes ticked ok</div><div><br></div><div>and also "Stefan Löffler & Jonathan Kew" - didn't actually write that script, the initial header was copied with their names in it - apologies.</div><div><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 13 Mar 2019 at 20:34, Paul A Norman <<a href="mailto:paul.a.norman@gmail.com" target="_blank">paul.a.norman@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi Iggor,</div><div><br></div><div>I can help you with 2. finding the current file directory.</div><div><br></div><div>I have a Script for TeXworks I often use :-)</div><div>See if it helps or what you need - lets know...</div><div><br></div><div>Use the TeXworks menu for Scripts/Scripting TeXworks, ask it to "Show Scripts Folder"</div><div><br></div><div>Then place the following in a plain text file in there called something like "openContainingDirectory.js"</div><div><br></div><div>Then in the Scripts Menu - use Scripting TeXworks, ask it to "Reload Scripts"</div><div><br></div><div>Next time you use your Scripts Menu you should see an item - "
Open containing directory" <br></div><div>Use it from within the TeXworks document you want to open.</div><div><br></div><div>(The following Script could be modified to just only show the path on the status panel at the bottom of TeXworks as well perhaps.)</div><div><br></div><div>I hope this helps,</div><div>kind regards,</div><div><br></div><div>Paul<br></div><div><br></div><div><br></div><div>// TeXworksScript<br>// Title: Open containing directory<br>// Description: Opens the directory containing the current file in the default file browser<br>// Author: Stefan Löffler & Jonathan Kew<br>// Version: 0.1.1<br>// Date: 2011-07-26<br>// Script-Type: standalone<br>// Shortcut: Alt+O, Alt+C, Alt+D<br><br>  eval(TW.app.getGlobal("helper_twPan")); //  Comment if NOT Needed - This includes PhpJs ($P), twConst, msgBox, twPan ($tw), string.toTitleCase() <br><br>function basename(str) {<br>    var base;<br><br>    base = str.replace(/\/[^\/]*$/, "");<br><br>    if(base == "") {<br>        if(TW.platform() == "Windows") // should never happen; there should always be <letter>: left<br>            base = "C:/"<br>        else<br>            base = "/";<br>    }<br>    <br>    if(TW.platform() == "Windows") // Windows 8.1 wants backslashes in *some* system calls<br>            base = base.replace(/\//g,"\\");<br>            <br>    return base;<br>}<br><br><br>// WIndows 81 has broken this... TeXworks needs to be "Run as Administrator"<br>   TW.launchFile(basename(TW.target.fileName));<br>   <br>  //TW.launchFile( TW.target.fileName );<br>/*<br>  var thisDirectory = basename(TW.target.fileName);<br> // thisDirectory =TW.target.fileName;<br>  <br>  cmd = "%windir%\\explorer.exe /E,\"" +  thisDirectory + "\"";<br>  <br>  twPan.file_put_contents( thisDirectory + "\\open.bat", cmd);<br>  <br>  twPan.osCmd("cmd /c \""+  thisDirectory  +"\\open.bat\"", true);<br>  <br>  <br>  TW.app.clipboard = cmd;<br>  <br>  twPan.alert(cmd);<br>  */<br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 13 Mar 2019 at 03:22, Iggor Ya. D. <<a href="mailto:iggor@sci.lebedev.ru" target="_blank">iggor@sci.lebedev.ru</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello!<br>
<br>
I work for some time with Texworks under Windows (primarily Win7 32).<br>
Now I have the newest version: TeXworks-win-setup-0.6.2-201704300708-git_7ecce17.exe<br>
While working I have encountered some issues with the program:<br>
<br>
1. Automated mailing form the Texworks to the mail list don't work:<br>
mailto:<a href="mailto:texworks@tug.org" target="_blank">texworks@tug.org</a>?... etc  - failed due to unknown reason. Mail<br>
agent was setup and mailto works from Firefox (but not from command<br>
prompt, of course).<br>
<br>
2. Very annoying issue:  while working with different versions of the<br>
same text it is almost impossible to figure out what version is opened<br>
(in which directory lays the current file). The only method is to try<br>
to save the file, but it is not so good and the user can rewrite the<br>
file unwillingly.<br>
<br>
Is there any ways to make available solution?<br>
<br>
-- <br>
С уважением,<br>
 Iggor                          mailto:<a href="mailto:iggor@sci.lebedev.ru" target="_blank">iggor@sci.lebedev.ru</a><br>
<br>
</blockquote></div>
</blockquote></div>
</blockquote></div>