[texworks] Problem with script shortcuts

Alain Delmotte esperanto at swing.be
Sun May 4 20:01:41 CEST 2014


Hi,

I have several scripts using combined 
shortcuts/accelerators, for example here is the content of 
the file chapter.lua in the scripts sub-folder of the 
TeXworks resources folder.
==============
--[[TeXworksScript
Title: d: chapter \c&hapter
Description: Encloses the current selection in \chapter{}
Author: Alain Delmotte from Stefan Löffler & Jonathan Kew
Version: 0.1
Date: 2011-11-01
Script-Type: standalone
Context: TeXDocument
Shortcut: Alt+W, Alt+&
]]

txt = TW.target.selection
if (txt == nil) then txt = "" end
TW.target.insertText("\\chapter{" .. txt .. "}")
TW.target.selectRange(TW.target.selectionStart - 
string.len(txt) - 1, string.len(txt))
==============

Alt+W is the first part of the combination (for structure 
scripts) and Alt+& for chapter (the & is lowercase on the 1 
key on a Belgian AZERTY keyboard)
The "&" character in the Title is an accelerator in the 
Windows menu (this I developed on my translation / 
localisation of TeXworks, I did it also for the English 
version and proposed it some time ago in this list.)

So it works; but you do not give much information on your 
system and scripts.

Regards,

Alain


Le 4/05/2014 14:28, Christophe Devalland a écrit :
> Hi,
> I'm using texworksVersion 0.5 r.1357 (launchpad)
> For my script, I have :
> // Shortcut: F9
> It works fine.
> With :
> // Shortcut: Ctrl+Shift+F
> it's OK too.
> But :
> // Shortcut: F9, Ctrl+Shift+F
> doesn't work ; neither F9  nor Ctrl+Shift+F
>
> Is it  bug ?
> Thank's
>





More information about the texworks mailing list