Hello everybody... This is the first time I write here.
First of all, I speak spanish, I'm from Argentina, and I found "in google" a little script for Linux that searchs word in a spanish diccionary (Real Academia Española) using lynx. I don't know anything about TCL, but I saw the plugin WhatIs, and I wanted to do something like this for searching in that dictionary. The result, I had readen the Jasper Huzen's code and I have copied a few lines to my/his plugin, and it's working know.
The reason why I'm writting here is because I wanted to share this with other people who may find this usefull, but I don't know where to send it, so, here it is:
-----begin of drae.tcl-----------------------------------------------------------------------------------
# Basado en el plugin "WhatIs" de Jasper Huzen
namespace eval ::drae {
proc init { dir } {
::plugins::RegisterPlugin "drae"
::plugins::RegisterEvent "drae" new_chatwindow addButtons
plugins_log "drae" "plugin registered"
}
proc getSelectedText { w } {
if { $::version == "0.94" } {
set window $w.f.bottom.in.input
if { [ catch {$window tag ranges sel}]} {
set window $w
}
set index [$window tag ranges sel]
if { $index == "" } {
set window $w.f.out.text
catch {set index [$window tag ranges sel]}
if { $index == "" } { return }
}
} else {
if { [ catch {set window [::ChatWindow::GetInputText $w]} ]} {
set window $w
}
set index [$window tag ranges sel]
if { $index == "" } {
set window [::ChatWindow::GetOutText $w]
catch {set index [$window tag ranges sel]}
if { $index == "" } { return }
}
}
set dump [$window dump -text [lindex $index 0] [lindex $index 1]]
if { $dump == "" } return
foreach { text output index } $dump {
append tpmVar $output
}
return $tpmVar
}
proc addButtons { event evpar } {
upvar 2 $evpar args
plugins_log "drae" "Add buttons to window"
set w $args(win)
set copymenu $w.copy
$copymenu add command -label "Diccionario RAE" -command "drae::drae $w"
}
proc drae { w } {
set searchText [getSelectedText $w]
if { $searchText == "" } {
::amsn::messageBox "No text selected!" ok error
} else {
set searchText [string tolower $searchText]
catch {exec lynx --dump --nolist
http://buscon.rae.es/draeI/SrvltGUIBusUsual?TIPO_HTML=2&LEMA=$searchText} output
::amsn::WinWrite [::ChatWindow::Name $w] "\n" green
if { $::version == "0.94" } {
::amsn::WinWrite [::ChatWindow::Name $w] "--------------------------------------------------" gray_italic
} else {
::amsn::WinWriteIcon [::ChatWindow::Name $w] greyline 3
}
::amsn::WinWrite [::ChatWindow::Name $w] "\n$output\n" gray
if { $::version == "0.94" } {
::amsn::WinWrite [::ChatWindow::Name $w] "--------------------------------------------------\n" gray_italic
} else {
::amsn::WinWriteIcon [::ChatWindow::Name $w] greyline 3
}
}
}
proc deInit { } {
::plugins::UnRegisterEvents "drae"
plugins_log "drae" "plugin unregistered"
}
}
-----end of drae.tcl-----------------------------------------------------------------------------------
-----begin of plugininfo.xml-----------------------------------------------------------------------------------
<?xml version="1.0"?>
<plugin>
<name>drae</name>
<author>Pablo Novara (and Jasper Huzen)</author>
<description>Busca la definicion del texto seleccionado en el diccionario de la Real Academia Española</description>
<amsn_version>0.94</amsn_version>
<plugin_version>1.0</plugin_version>
<plugin_file>drae.tcl</plugin_file>
<plugin_namespace>drae</plugin_namespace>
<init_procedure>init</init_procedure>
<deinit_procedure>deInit</deinit_procedure>
</plugin>
-----end of plugininfo.xml-----------------------------------------------------------------------------------
So, if somebody like this idea can tell me what to do, or where to send that little code... The only problem is that it's only for Spanish speaking people.
Thanks anyway. And happy new year!
P.S.: does anybody knows Jasper (WhatIs Plugin's author) ?... Say thanks to him for the code

.