Current date in the tool command line

Current date in the tool command line

4
NewbieNewbie
4

    Mar 03, 2006#1

    I've got a command line that runs an executable on the currently editable file and dictates the specific location of the log file output from that executable. I'd like to be able to put something like c:\temp\%n.log_%dt where %dt is the current date and time. Has anyone found such an option, or come up with a fancy hack?

    I'm aware of the file based replacement variables, but don't see anything with dates. Thanks.

    344
    MasterMaster
    344

      Mar 03, 2006#2

      can't your "executable" (b.t.w.: what is it ? a vb-script ? a selfmade exe ?)
      rename the logfile (with date and time) at the end of the process ?
      rds Bego
      Normally using all newest english version incl. each hotfix. Win 10 64 bit

      6,681583
      Grand MasterGrand Master
      6,681583

        Mar 03, 2006#3

        If you use %sel% for your tool instead of c:\temp\%n.log_%dt and run the tool with this macro, you will get what you want.

        The macro copies the full name of the current file, pastes it into a new file, reformats the file name to c:\temp\%n.log_ and adds the current date/time. You can modify the format of the date/time string also with the macro. Then it selects the whole string and runs the tool. After the tool has finished, the new file is discarded.

        At the configuration of your tool, do not enable save current file or save all files because of the unsaved new file created by the macro. If you want to save the current file or all files, use the Save or SaveAll macro commands for example after command HexOff.

        If you want to see which string the macro produce, remove the last 2 commands.

        IfNameIs ""
        ExitMacro
        EndIf
        InsertMode
        ColumnModeOff
        HexOff
        Clipboard 9
        CopyFilePath
        IfExtIs ""
        NewFile
        Paste
        Else
        NewFile
        Paste
        StartSelect
        Find Up Select "."
        Delete
        EndSelect
        EndIf
        ClearClipboard
        Clipboard 0
        Find Up "\"
        SelectToTop
        Delete
        ""C:\Temp\"
        Key END
        ".log_"
        TimeDate
        """
        SelectToTop
        RunTool "case-sensitive name of your tool"
        CloseFile NoSave
        Best regards from an UC/UE/UES for Windows user from Austria