How to save the active file with new extension?

How to save the active file with new extension?

2
NewbieNewbie
2

    Aug 23, 2006#1

    I have a macro below that edits the active file (abc.txt) but then I cannot save it with a new extension (abc.maa), keeping the same format.

    CopyFilePath - this is useful only if I can change the file extension to .maa - is there a way to do this?
    If so, then maybe I can use...... SaveAs "^c"

    Any help appreciated.


    InsertMode
    ColumnModeOff
    HexOff
    UnixReOff
    TrimTrailingSpaces
    ....
    other editing commands
    ....
    SaveAs "F:\Ham\MMANA\abc.maa" where abc is the active filename

    6,686585
    Grand MasterGrand Master
    6,686585

      Aug 24, 2006#2

      Add the following lines at the end of your macro:

      InsertMode
      Clipboard 9
      CopyFilePath
      Top
      Paste
      Find Up Select "."
      Delete
      ".maa"
      SelectToTop
      Cut
      SaveAs "^c"
      ClearClipboard
      Clipboard 0
      Best regards from an UC/UE/UES for Windows user from Austria

      2
      NewbieNewbie
      2

        Aug 24, 2006#3

        Thank you Mofi! Yes, that works of course, but it is a huge kludge!

        Perhaps one day Ian Mead may add the variables for active filename and extension...that would make many macros much shorter!

        6,686585
        Grand MasterGrand Master
        6,686585

          Aug 24, 2006#4

          Also possible is to define a template which inserts the not modified parts of the filename with an other extension. Templates can be also executed from within a macro. See help of UltraEdit about templates and there special codes for filename handling. But you still have to cut the new filename inserted by the template to the clipboard before you can use it in the SaveAs or Open dialog.
          Best regards from an UC/UE/UES for Windows user from Austria