set button [lindex $argv 0]
GuidoApp app "SELECT LAYER"
set layername [string trim [$button getCurrentValue]]
if {[string length $layername] != 0} {
$app setParam activelayer $layername
set status [$app invoke]
if {$status == -1} {
set databuf [GuidoExecServer ActiveLayer {}]
set layername [GuidoGetParamBufferValue $databuf activelayer]
$app setParam activelayer $layername
set status [$app invoke]
}
} else {
set databuf [GuidoExecServer ActiveLayer {}]
set layername [GuidoGetParamBufferValue $databuf activelayer]
$button setCurrentValue $layername
}
$app destroy
