Hi
I have a script : to remove the characters WBS and replace with NIBTS
proc set_outbound_name {args} {
# Extract MODE safely
if {[catch {keylget args MODE mode}]} {
return “”
}
# ✅ Ignore startup call
if {$mode eq “start”} {
return “”
}
# Extract MSGID and ARGS safely
if {[catch {keylget args MSGID msgid}]} {
return “”
}
if {[catch {keylget args ARGS innerArgs}]} {
set innerArgs {}
}
# ✅ Get driverControl (this is where FILENAME lives)
set driverControl [msgget $msgid]
# Extract filename from driverControl list
if {[catch {keylget driverControl FILENAME fname}]} {
return
}
set base [file tail $fname]
# DEBUG (leave enabled for now)
HciAlert -info “FINAL DEBUG: original filename = $fname”
if {[string match “WBS*” $base]} {
regsub {^WBS} $base “NIBTS” newbase
set dir [file dirname $fname]
set newfname [file join $dir $newbase]
# ✅ Write back into driverControl
keylset driverControl FILENAME $newfname
# ✅ Save updated driverControl
msgset $msgid $driverControl
HciAlert -info “FINAL DEBUG: new filename = $newfname”
}
return
But it doesnt work -Any advice ?
Thanks in advance