First things first.
According to The Kile Handbook, chapter 13, "Kile's scripting feature allows for the execution of ECMAScript code. Scripts can be managed
Unfortunately, my answer won't TeX-related. But here we go.
A quick look into the ECMAScript Language Specification plus the section 13.2 (API Reference) of The Kile Handbook made me come up with the following example:
I created a new script and called
myscript.js with the content described as follows; Kile seems to save them in a specific scripts folder.
var myCurrentDoc = (kile).currentTextDocument()
var myName = (kile).getInputValue("Answer the question!", "What is your name?")
myCurrentDoc.insertText("Hello " + myName)
In line 1, I get a
KileTextDocument object which reflects the currently active text document. Please note that my code has no error checking! In line 2, the
getInputValue method opens a dialog with the given caption and label; the variable
myName gets the returned value. In line 3, I simply insert the text.
I saved the script and now it's available on the sidebar:
Let's say I create a dummy
test.tex file with the following content:
| % suppose the cursor is here.
Running the script:
There we go! My first script in Kile.
Take a look in the API Reference. It might have some useful methods, but beware! According to the handbook:
Please note that the scripting API has not been finalized yet. The API described below might change in future versions of Kile.
Sorry to come up with this simple example, that's the only idea I had in such short time.
By the way: boas festas, amigo!