SaveAs "current directory"

SaveAs "current directory"


    May 22, 2008#1


    I'd like to know if there's a way to use SaveAs macro command to save the file under the same directory the file has been opened. I was just typing SaveAs "myfilename.htm" and the file wasn't created... So I tried putting a full path with SaveAs "C:\dirA\dir0xxx\myfilename.htm" and that worked. But since I need to apply this macro on hundreds of files and the dir0xxx aren't , of course, the same for each files, I can't put the full path.

    I need to put SaveAs @currentDir&"myfilename.htm" (pseudo code)
    Is it possible with UltraEdit10.00c ?

    If not, with a newer version of UE ?


    Grand MasterGrand Master

      May 23, 2008#2

      If configuration setting Use active file directory for file open dialog default is set, the macro command SaveAs "new name of file" without a path will save in the same directory as active file is. Without this setting you have to create the full file name you want, for example with following code:

      Find Up Select "\"
      "new name of file"
      SaveAs "^c"

      This macro moves the cursor to top of the active file. Next it copies the full file name of the active file into the active clipboard and pastes it into the file. The cursor is now at the end of the inserted file name. The next command searches upwards for the last backslash in the file path and at the same time selects all text from current cursor position to end of found string. So it selects the name of the active file with the last backslash in the path. This selection is replaced by only a backslash = name of file is deleted. Next the new name of the file is inserted. The last 3 commands select the new full file name, cut it into the active clipboard and saves the file with the new full file name in the active clipboard.
      Best regards from an UC/UE/UES for Windows user from Austria