bso its

Forum Replies Created

Viewing 2 replies – 1 through 2 (of 2 total)
  • Author
    Replies
  • in reply to: File name (amending first 3 characters) #122570
    bso its
    Participant

      Hi

      I had a few errors in the code but below is a working tcl script :

      proc set_outbound_name {args} {

      set dispList {}

      # Get mode
      set mode “”
      catch {keylget args MODE mode}

      if {$mode ne “run”} {
      return $dispList
      }

      # Get message ID
      set msgid “”
      catch {keylget args MSGID msgid}

      if {$msgid eq “”} {
      echo “DEBUG: MSGID missing”
      return $dispList
      }

      # ✅ Get FULL existing DRIVERCTL
      set driverControl [msgmetaget $msgid DRIVERCTL]

      # Get original filename
      set fname “”
      catch {keylget driverControl FILENAME fname}

      if {$fname ne “”} {

      echo “DEBUG: Existing filename = $fname”

      set base [file tail $fname]

      if {[string match “WBS*” $base]} {

      echo “DEBUG: WBS match found”

      regsub {^WBS} $base “NIBTS” newbase

      echo “DEBUG: New filename = $newbase”

      # ✅ SAFE UPDATE — do NOT overwrite DRIVERCTL
      keylset driverControl FILESET.OBFILE $newbase

      # (optional but fine to keep)
      catch {keylset driverControl OUTFILE $newbase}

      # Save updated structure
      msgmetaset $msgid DRIVERCTL $driverControl

      echo “DEBUG: DRIVERCTL updated (OBFILE patched)”
      }
      }

      # ✅ Correct return
      lappend dispList “CONTINUE $msgid”

      return $dispList
      }

      Thanks again for your help  – much appreciated

       

      in reply to: File name (amending first 3 characters) #122569
      bso its
      Participant

        Thank you for the replies (much appreciated)

        Will make amends and let you know.

        The issue is that its not attaching the “new” file name so its failing by saying file name is blank

        Thanks again

      Viewing 2 replies – 1 through 2 (of 2 total)