<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Dear Iggor,</div><div><br></div><div>I'm pleased that gave you some immediate help, sounds like 
<span class="gmail-qu" tabindex="-1"><span name="Stefan Löffler" class="gmail-gD">Stefan Löffler</span></span>

 may be planning something more directly integrated into TeXworks.</div><div><br></div><div>I have not been able to repeat what you see with Alt D by itself activating the Script(?)</div><div><br></div><div>You could alter the Shortcut section at the top of the script to just be...</div><div><br></div><div>
// Shortcut: Alt+D </div><div><br></div><div>or <br></div><div><br></div><div>
// Shortcut: Alt+S, Alt+D <br></div><div><br></div><div>I use three letter ones to keep more options open going forward for new scripts, using just Alt D rules out later using anything else starting with D, and you soon run out of letters of the alphabet :-)</div><div><br></div><div>There's a little bit more Scripting information here if you want to make your own...</div><div></div><div><a href="http://twscript.paulanorman.info/">http://twscript.paulanorman.info/</a></div><div><br></div><div>A few Docs...<br><a href="http://twscript.paulanorman.info/docs/index.html">http://twscript.paulanorman.info/docs/index.html</a><br></div><div><br></div><div>Online Api...<br><a href="http://twscript.paulanorman.info/docs/html/TexWorksQtScripting.htm">http://twscript.paulanorman.info/docs/html/TexWorksQtScripting.htm</a><br></div><div><br></div><div><u><b>TeXworks 0.7</b></u><br></div><div><br></div><div>> " <b>and newest </b>[TeXworks]<b> 0.7 don't work with my mikTeX</b> (???). "<br></div><div><br></div><div>You may want to raise that as a separate issue - as I'm sure<span class="gmail-qu" tabindex="-1"><span name="Stefan Löffler" class="gmail-gD"> Stefan Löffler</span></span>

 and others may want to review that situation.</div><div><br></div><div>I'm not sure which 
MiKTeX 

you're running, I currently run an <u>older</u> MiKTeX Portable.<br></div><div><br></div><div>I have found in the past that using a "Command Prompt" generated from within the MiKTeX (Portable) icon in the Windows Notification area (normally pushing the mouse at the bottom right of your screen), and starting TeXworks from within that MiKTeX Command Prompt, gives you any needed environment variables, and paths that might otherwise be missing.</div><div><br></div><div>(Some of this is specific to my particular situation, but you'll get the gist of it...)<br></div><div><br></div><div>Inside the MikTeX "Command Prompt" I run a batch file "golatex.bat" which is in my general path..</div><div><br></div><div>g:<br>cd G:\LaTeXPortable<br>TW.bat</div><div><br></div><div>And for reasons of calling it from elsewhere and also making it easier to change which TeXworks I'm running, I have "TW.bat" simply as...</div><div><br></div><div>\latexportable\LaTexUtils\TeXWorks\texworks\texworks.exe %1 %2 %3 %4<br></div><div><br></div><div></div><div>Any way by whatever means, perhaps try running TeXworks 0.7 from within a MiKTex created "Command Prompt" (or Powershell if your system intercepts the call, and presents Powershell instead) and see what happens?<br></div><div><br></div><div>Paul<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 15 Mar 2019 at 23:48, Iggor Ya. D. <<a href="mailto:iggor@sci.lebedev.ru">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">Hi Paul,<br>
<br>
Thank you very much! Actually, I returned to Texworks 0.4, since it<br>
works, and newest 0.7 don't work with my mikTeX (???). But your<br>
script works excellent in my current version too! I has one more question:<br>
why it worked namely for Alt-D? The script seems to have no settings<br>
for this, isn't it?<br>
<br>
<br>
<br>
Вы писали 13 марта 2019 г., 13:30:09:<br>
PAN> Hi Iggor,<br>
<br>
PAN> Sorry about that I had been rushing to another commitment.<br>
<br>
PAN> Here is a simple Script that should show you your containing directory.<br>
<br>
PAN> Place it (as "showContainingDirectory.js") on your hard-drive as<br>
PAN> described before, and reload the TeXworks Script list as also described before.<br>
<br>
PAN> Once the Script list is reloaded you can invoke it from within a current document by using the<br>
PAN> holding down ALT key<br>
<br>
PAN> tap once each of:<br>
<br>
PAN> S C D keys<br>
<br>
PAN> Or from the TeXworks Scripts menu itself as, "Show Containing Directory"<br>
<br>
PAN> Apologies again,<br>
<br>
PAN> Paul<br>
PAN> - - - - <br>
<br>
<br>
PAN> // TeXworksScript<br>
PAN> // Title: Show Containing Directory<br>
PAN> // Description: Showss the directory containing the current file in the default file browser<br>
PAN> // Author: Paul A. Norman<br>
PAN> // Version: 0.1.0<br>
PAN> // Date: 2019-03-13<br>
PAN> // Script-Type: standalone<br>
PAN> // Shortcut: Alt+S, Alt+C, Alt+D<br>
<br>
PAN>  <br>
PAN> function basename(str) {<br>
PAN>     var base;<br>
<br>
PAN>     base = str.replace(/\/[^\/]*$/, "");<br>
<br>
PAN>     if(base == "") { <br>
PAN>                         // should never happen; there should always be <letter>: left<br>
<br>
PAN>         if(TW.platform() == "Windows") <br>
PAN>             base = "C:/"<br>
PAN>         else<br>
PAN>             base = "/";<br>
PAN>     }<br>
PAN>     <br>
PAN>     // if(TW.platform() == "Windows") // Windows 8.1 wants<br>
PAN> backslashes in *some* system calls<br>
PAN>     //        base = base.replace(/\//g,"\\");<br>
PAN>             <br>
PAN>     return base;<br>
PAN> }<br>
<br>
<br>
PAN>  var path = basename(TW.target.fileName);<br>
PAN>    <br>
PAN>  TW.information(null, 'Document Path-', path);<br>
PAN>   <br>
PAN>   // Uncomment the following if you want to automatically copy<br>
PAN> the path to the clipboard as well ...<br>
<br>
PAN>  // TW.app.clipboard = path;<br>
PAN>   <br>
PAN>  <br>
PAN>   null;<br>
<br>
<br>
PAN> On Wed, 13 Mar 2019 at 23:00, Paul A Norman<br>
PAN> <<a href="mailto:paul.a.norman@gmail.com" target="_blank">paul.a.norman@gmail.com</a>> wrote:<br>
PAN> P.S.<br>
<br>
PAN> I'll write you a direct script later.<br>
<br>
PAN> There are a couple of prerequisites in what I sent you, that you<br>
PAN> won't want to bother with downloading and setting up<br>
PAN> (eval(TW.app.getGlobal("helper_twPan"));)<br>
<br>
PAN> And eventually you will need to check your Scripting Security settings under...<br>
<br>
PAN> Edit/ Preferences / Scripts <br>
<br>
PAN> May need most boxes ticked ok<br>
<br>
PAN> and also "Stefan Löffler & Jonathan Kew" - didn't actually write<br>
PAN> that script, the initial header was copied with their names in it - apologies.<br>
<br>
<br>
PAN> On Wed, 13 Mar 2019 at 20:34, Paul A Norman<br>
PAN> <<a href="mailto:paul.a.norman@gmail.com" target="_blank">paul.a.norman@gmail.com</a>> wrote:<br>
PAN> Hi Iggor,<br>
<br>
PAN> I can help you with 2. finding the current file directory.<br>
<br>
PAN> I have a Script for TeXworks I often use  <br>
PAN> See if it helps or what you need - lets know...<br>
<br>
PAN> Use the TeXworks menu for Scripts/Scripting TeXworks, ask it to "Show Scripts Folder"<br>
<br>
PAN> Then place the following in a plain text file in there called<br>
PAN> something like "openContainingDirectory.js"<br>
<br>
PAN> Then in the Scripts Menu - use Scripting TeXworks, ask it to "Reload Scripts"<br>
<br>
PAN> Next time you use your Scripts Menu you should see an item - " Open containing directory"<br>
PAN> Use it from within the TeXworks document you want to open.<br>
<br>
PAN> (The following Script could be modified to just only show the<br>
PAN> path on the status panel at the bottom of TeXworks as well perhaps.)<br>
<br>
PAN> I hope this helps,<br>
PAN> kind regards,<br>
<br>
PAN> Paul<br>
<br>
<br>
PAN> // TeXworksScript<br>
PAN> // Title: Open containing directory<br>
PAN> // Description: Opens the directory containing the current file in the default file browser<br>
PAN> // Author: Stefan Löffler & Jonathan Kew<br>
PAN> // Version: 0.1.1<br>
PAN> // Date: 2011-07-26<br>
PAN> // Script-Type: standalone<br>
PAN> // Shortcut: Alt+O, Alt+C, Alt+D<br>
<br>
PAN>   eval(TW.app.getGlobal("helper_twPan")); //  Comment if NOT<br>
PAN> Needed - This includes PhpJs ($P), twConst, msgBox, twPan ($tw), string.toTitleCase()<br>
<br>
PAN> function basename(str) {<br>
PAN>     var base;<br>
<br>
PAN>     base = str.replace(/\/[^\/]*$/, "");<br>
<br>
PAN>     if(base == "") {<br>
PAN>         if(TW.platform() == "Windows") // should never happen;<br>
PAN> there should always be <letter>: left<br>
PAN>             base = "C:/"<br>
PAN>         else<br>
PAN>             base = "/";<br>
PAN>     }<br>
PAN>     <br>
PAN>     if(TW.platform() == "Windows") // Windows 8.1 wants<br>
PAN> backslashes in *some* system calls<br>
PAN>             base = base.replace(/\//g,"\\");<br>
PAN>             <br>
PAN>     return base;<br>
PAN> }<br>
<br>
<br>
PAN> // WIndows 81 has broken this... TeXworks needs to be "Run as Administrator"<br>
PAN>    TW.launchFile(basename(TW.target.fileName));<br>
PAN>    <br>
PAN>   //TW.launchFile( TW.target.fileName );<br>
PAN> /*<br>
PAN>   var thisDirectory = basename(TW.target.fileName);<br>
PAN>  // thisDirectory =TW.target.fileName;<br>
PAN>   <br>
PAN>   cmd = "%windir%\\explorer.exe /E,\"" +  thisDirectory + "\"";<br>
PAN>   <br>
PAN>   twPan.file_put_contents( thisDirectory + "\\open.bat", cmd);<br>
PAN>   <br>
PAN>   twPan.osCmd("cmd /c \""+  thisDirectory  +"\\open.bat\"", true);<br>
PAN>   <br>
PAN>   <br>
PAN>   TW.app.clipboard = cmd;<br>
PAN>   <br>
PAN>   twPan.alert(cmd);<br>
PAN>   */<br>
<br>
PAN> 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>
PAN> Hello!<br>
<br>
PAN> I work for some time with Texworks under Windows (primarily Win7 32).<br>
PAN> Now I have the newest version:<br>
PAN> TeXworks-win-setup-0.6.2-201704300708-git_7ecce17.exe<br>
PAN> While working I have encountered some issues with the program:<br>
<br>
PAN> 1. Automated mailing form the Texworks to the mail list don't work:<br>
PAN> mailto:<a href="mailto:texworks@tug.org" target="_blank">texworks@tug.org</a>?... etc  - failed due to unknown reason. Mail<br>
PAN> agent was setup and mailto works from Firefox (but not from command<br>
PAN> prompt, of course).<br>
<br>
PAN> 2. Very annoying issue:  while working with different versions of the<br>
PAN> same text it is almost impossible to figure out what version is opened<br>
PAN> (in which directory lays the current file). The only method is to try<br>
PAN> to save the file, but it is not so good and the user can rewrite the<br>
PAN> file unwillingly.<br>
<br>
PAN> Is there any ways to make available solution?<br>
<br>
<br>
<br>
<br>
-- <br>
Sincerely,<br>
 Iggor                          mailto:<a href="mailto:iggor@sci.lebedev.ru" target="_blank">iggor@sci.lebedev.ru</a><br>
<br>
</blockquote></div></div></div></div></div></div></div>