<div dir="ltr">
<div>HI Philip,</div><div><br></div><div><span style="color:rgb(11,83,148)"><span style="background-color:rgb(243,243,243)">>"
Oh, and Ctrl-0 for "fit the screen", in
addition to the current Ctrl-3 </span></span><br></div><div><br></div><div>I'm not sure "<i>fit the screen</i>" is what you really meant, but if so, here you go. (I was thinking you probably didn't want a shortcut combination for something that already existed (
<span style="color:rgb(11,83,148)"><span style="background-color:rgb(243,243,243)">Ctrl-3</span></span>
) or really needed a new Crtl 0 combination for eye/muscle memory, perhaps from using another Editor environment or something? <br></div><div><br></div><div>So here we go, I think a shortcut combination already exists for this as well? <span style="color:rgb(255,255,255)"><span style="background-color:rgb(191,144,0)"> CTRL SHIFT F </span></span> and it toggles, <br>but anyway worthwhile walking through so you could see how to make other things that might be available to anyone already perhaps...</div><div><br></div><div>Put this (using notepad even — or TeXworks itself) in a new folder if you want under your Scripts folder (or just on top there).<br></div><div><br></div><div>You'll get there by following your <span style="color:rgb(243,243,243)"><span style="background-color:rgb(106,168,79)"> Script/ Scripting TeXworks/ Show Script Folder </span></span> menu flow.</div><div><br></div><div style="margin-left:40px"><img src="cid:ii_kv90md3l0" alt="image.png" width="544" height="70"></div><div><br></div><div></div><div><span style="background-color:rgb(147,196,125)"><span style="color:rgb(243,243,243)"></span></span> <br>You could call the file say: <span style="background-color:rgb(0,0,0)"><span style="color:rgb(243,243,243)"> fitToScreen.js </span></span> or AnythingElseYouLike<span style="color:rgb(116,27,71)">.js</span> but it must completely end <span style="color:rgb(255,255,255)"><span style="background-color:rgb(0,0,0)"> <b>.</b>js <br></span></span></div><div><span style="color:rgb(255,255,255)"><span style="background-color:rgb(0,0,0)"><br></span></span></div><div></div><div style="margin-left:40px"><img src="cid:ii_kv91fsdi1" alt="image.png" width="544" height="281"><br></div><div><br></div><div>... Watch out if you have file extensions for known file types turned off, or your file might inevitably end in .txt or .tex, so if using notepad choose all file types as your extension when saving and add <span style="color:rgb(255,255,255)"><span style="background-color:rgb(0,0,0)"><b> .</b>js </span></span>
to the end manually.<br></div><div></div><div style="margin-left:40px">
<p style="margin:0px;text-indent:0px;line-height:100%;white-space:pre-wrap"><span style="background-color:rgb(255,242,204)"><span style="color:rgb(106,168,79)"><br></span></span></p><p style="margin:0px;text-indent:0px;line-height:100%;white-space:pre-wrap"><span style="background-color:rgb(255,242,204)"><span style="color:rgb(106,168,79)"><br></span></span></p><p style="margin:0px;text-indent:0px;line-height:100%;white-space:pre-wrap"><span style="background-color:rgb(255,242,204)"><span style="color:rgb(106,168,79)">// TeXworksScript</span></span></p><span style="background-color:rgb(255,242,204)"><span style="color:rgb(106,168,79)">
</span></span><p style="margin:0px;text-indent:0px;line-height:100%;white-space:pre-wrap"><span style="background-color:rgb(255,242,204)"><span style="color:rgb(106,168,79)">// Title: Fit to Screen Size</span></span></p><span style="background-color:rgb(255,242,204)"><span style="color:rgb(106,168,79)">
</span></span><p style="margin:0px;text-indent:0px;line-height:100%;white-space:pre-wrap"><span style="background-color:rgb(255,242,204)"><span style="color:rgb(106,168,79)">// Description: Philip Taylor request Fit to Screen</span></span></p><span style="background-color:rgb(255,242,204)"><span style="color:rgb(106,168,79)">
</span></span><p style="margin:0px;text-indent:0px;line-height:100%;white-space:pre-wrap"><span style="background-color:rgb(255,242,204)"><span style="color:rgb(106,168,79)">// Author: Paul A Norman</span></span></p><span style="background-color:rgb(255,242,204)"><span style="color:rgb(106,168,79)">
</span></span><p style="margin:0px;text-indent:0px;line-height:100%;white-space:pre-wrap"><span style="background-color:rgb(255,242,204)"><span style="color:rgb(106,168,79)">// Version: 0.1</span></span></p><span style="background-color:rgb(255,242,204)"><span style="color:rgb(106,168,79)">
</span></span><p style="margin:0px;text-indent:0px;line-height:100%;white-space:pre-wrap"><span style="background-color:rgb(255,242,204)"><span style="color:rgb(106,168,79)">// Date: 2021-10-27</span></span></p><span style="background-color:rgb(255,242,204)"><span style="color:rgb(106,168,79)">
</span></span><p style="margin:0px;text-indent:0px;line-height:100%;white-space:pre-wrap"><span style="background-color:rgb(255,242,204)"><span style="color:rgb(106,168,79)">// Script-Type: standalone</span></span></p><span style="background-color:rgb(255,242,204)"><span style="color:rgb(106,168,79)">
</span></span><p style="margin:0px;text-indent:0px;line-height:100%;white-space:pre-wrap"><span style="background-color:rgb(255,242,204)"><span style="color:rgb(106,168,79)">// Context: PDFDocument</span></span></p><span style="background-color:rgb(255,242,204)"><span style="color:rgb(106,168,79)">
</span></span><p style="margin:0px;text-indent:0px;line-height:100%;white-space:pre-wrap"><span style="background-color:rgb(255,242,204)"><span style="color:rgb(106,168,79)">// Shortcut: CTRL+0</span></span></p><span style="background-color:rgb(255,242,204)">
</span><p style="margin:0px;text-indent:0px;line-height:100%;white-space:pre-wrap"><span style="background-color:rgb(255,242,204)"><br></span></p><span style="background-color:rgb(255,242,204)">
</span><p style="margin:0px;text-indent:0px;line-height:100%;white-space:pre-wrap"><span style="background-color:rgb(255,242,204)"><span style="color:rgb(0,0,0)">TW.target.showMaximized();</span></span></p><p style="margin:0px;text-indent:0px;line-height:100%;white-space:pre-wrap"><span style="background-color:rgb(255,242,204)"><span style="color:rgb(0,0,0)"><br></span></span></p><p style="margin:0px;text-indent:0px;line-height:100%;white-space:pre-wrap"><span style="background-color:rgb(255,242,204)"><span style="color:rgb(0,0,0)"><br></span></span></p></div><div></div><div></div><div>
Then after saving, use <span style="background-color:rgb(147,196,125)"><span style="color:rgb(243,243,243)"> Scripts/ Scripting TeXworks/ Reload Script List </span></span><br><br></div><div>Thereafter, whilst your pdf window has the focus in TeXworks, you can use Ctrl 0 keys together as usual (it obviously won't work if you are "focussed" in the editor area.)<br></div><div><br></div><div><u><b>However if you meant</b></u> you wanted the same as, Menu: <span style="background-color:rgb(106,168,79)"><span style="color:rgb(255,255,255)"> View/ Fit to Window Crtl 3 </span></span>, I'm afraid I can not find anything in the Scripting debugger TeXworks version 0.6.6 MikTex 21.10 (I'm using to see what others go on about from MiKTeX from time to time), that gives us anything obvious to work with in Scripting. <br></div><div>(To see the Script Debugger, simply create a script with a deliberate error in it. For example in the script above</div><div>
<span style="color:rgb(0,0,0)">TW.target.showMaximized()</span><span style="color:rgb(0,0,0)">;</span> could be changed to
<span style="color:rgb(0,0,0)">TW.target.<i><b>XX</b></i>showMaximized();</span> then save and try to run the script.)<br></div><div><br></div><div>Presently the TeXworks Scripting Api is at (though that may change in the near future:</div><div> :-)<br></div><div style="margin-left:40px"><a href="https://twscript.paulanorman.com/docs/html/TexWorksQtScripting.htm">https://twscript.paulanorman.com/docs/html/TexWorksQtScripting.htm</a></div><div style="margin-left:40px"><br>Look in the left menu for:<br></div><div style="margin-left:40px">
<b>TeXworks Script Api functions and properties</b>
</div><div><span style="color:rgb(0,0,0)"></span></div><div><br></div><div>But always remember to look in the debugger for new scripting objects etc.</div><div><br></div><div>In this case, unless there are some deeper scripting object properties / methods already available hiding down deep,<br> AFAIK, that is all Scripting can do for you for now :-)</div><div><br></div><div>Kind regards,</div><div>Paul<br></div>
</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 19 Oct 2021 at 22:10, Philip Taylor <<a href="mailto:P.Taylor@hellenic-institute.uk">P.Taylor@hellenic-institute.uk</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 bgcolor="#FFFFFF">
<div>On 24/05/2021, 12:01, Philip Taylor
wrote:<br>
<br>
</div>
<blockquote type="cite">
Buglet — let source documents A and B be concurrently open in
TeXworks, and let document A be the currently active one. Using
the "Window" menu, make document B active, and press Ctrl+F.
Focus is transferred back to document A and the search carried out
therein, whereas the intention was to search document B.<br>
<br>
Feature request — still desperate (and increasingly so) for
draggable rulers. PLEASE ! Oh, and Ctrl-0 for "fit the screen",
in addition to the current Ctrl-3.<br>
</blockquote>
<br>
The "buglet" is really becoming a pain in the fundament — may I
respectfully ask if there is any likelihood of it (and ideally the
feature request, which I also desperately need) being addressed in
the foreseeable future ?<br>
-- <br>
<i>** Phil.</i><br>
</div>
</blockquote></div>