[texworks] TeXworks — buglet and requested feature.
Paul A Norman
paul.a.norman at gmail.com
Wed Oct 27 07:00:09 CEST 2021
HI Philip,
>" Oh, and Ctrl-0 for "fit the screen", in addition to the current Ctrl-3
I'm not sure "*fit the screen*" 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 ( Ctrl-3 ) or really needed a new Crtl 0
combination for eye/muscle memory, perhaps from using another Editor
environment or something?
So here we go, I think a shortcut combination already exists for this as
well? CTRL SHIFT F and it toggles,
but anyway worthwhile walking through so you could see how to make other
things that might be available to anyone already perhaps...
Put this (using notepad even — or TeXworks itself) in a new folder if you
want under your Scripts folder (or just on top there).
You'll get there by following your Script/ Scripting TeXworks/ Show
Script Folder menu flow.
[image: image.png]
You could call the file say: fitToScreen.js or AnythingElseYouLike.js
but it must completely end *.*js
[image: image.png]
... 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 * .*js to
the end manually.
// TeXworksScript
// Title: Fit to Screen Size
// Description: Philip Taylor request Fit to Screen
// Author: Paul A Norman
// Version: 0.1
// Date: 2021-10-27
// Script-Type: standalone
// Context: PDFDocument
// Shortcut: CTRL+0
TW.target.showMaximized();
Then after saving, use Scripts/ Scripting TeXworks/ Reload Script List
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.)
*However if you meant* you wanted the same as, Menu: View/ Fit to Window
Crtl 3 , 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.
(To see the Script Debugger, simply create a script with a deliberate error
in it. For example in the script above
TW.target.showMaximized(); could be changed to TW.target.*XX*
showMaximized(); then save and try to run the script.)
Presently the TeXworks Scripting Api is at (though that may change in the
near future:
:-)
https://twscript.paulanorman.com/docs/html/TexWorksQtScripting.htm
Look in the left menu for:
*TeXworks Script Api functions and properties*
But always remember to look in the debugger for new scripting objects etc.
In this case, unless there are some deeper scripting object properties /
methods already available hiding down deep,
AFAIK, that is all Scripting can do for you for now :-)
Kind regards,
Paul
On Tue, 19 Oct 2021 at 22:10, Philip Taylor <P.Taylor at hellenic-institute.uk>
wrote:
> On 24/05/2021, 12:01, Philip Taylor wrote:
>
> 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.
>
> 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.
>
>
> 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 ?
> --
> *** Phil.*
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/texworks/attachments/20211027/c8a7956e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 19886 bytes
Desc: not available
URL: <https://tug.org/pipermail/texworks/attachments/20211027/c8a7956e/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 62431 bytes
Desc: not available
URL: <https://tug.org/pipermail/texworks/attachments/20211027/c8a7956e/attachment-0003.png>
More information about the texworks
mailing list.