Running Macro from CMD line syntax ?

Running Macro from CMD line syntax ?

2
NewbieNewbie
2

    Dec 02, 2004#1

    I have a Macro that I've created to add a dummy row to the top of an HTM Table to get around some Microsoft glitch in determining variable type. I called the Macro "RemoveLines" and saved a MAC file to \\TOROON63724\d$\InetPub\ftproot\TIASftp\TIAS.MAC

    I've tried a few variations, like below, and keep getting a syntax error.
    Can someone help me with the correct syntax. Thanks.

    C:\Progra~1\UltraEdit\UEDIT32.EXE \\TOROON63724\d$\InetPub\ftproot\TIASftp\613525.htm /M="\\TOROON63724\d$\InetPub\ftproot\TIASftp\TIAS/RemoveLines"

    The HTM file generates the error "Do you want to convert \\path\filename.htm to DOS format?" Upon clicking No it fails with the syntax error message. Any idea how to get around the convert question? I believe my syntax is correct maybe just a switch. I tested it on a dummy plain text file and syntactically it works fine :?: .

      Dec 02, 2004#2

      Reverting back to DOS, joy oh bliss.
      Had to tildefy all elements of the path, take off "Auto detect Unix files" in configuration and all is well.

      C:\Progra~1\UltraE~1\UEDIT32.EXE \\TOROON63724\d$\InetPub\ftproot\TIASftp\613525.htm /M,E,1="\\TOROON63724\d$\InetPub\ftproot\TIASftp\TIAS.MAC/RemoveLines"

      1
      NewbieNewbie
      1

        Jan 05, 2005#3

        Getting syntax errors from a batch file, confused as to what I'm doing wrong.

        ---------------------------
        UltraEdit
        ---------------------------
        C:\WINDOWS\system32\,E,1="C:\Loz.MAC leanPE contains an invalid path.
        ---------------------------
        OK
        ---------------------------

        The command line I'm using in the batch file is:

        start uedit32.exe C:\pinginfo.txt /M,E,1="C:\Loz.MAC /CleanPE"

        I've tried it without the start, and had no luck. I've trimmed the pathing down to just being on the root of the C: drive for the time being, just to get it working.

        Any help is appreciated.

        6,603548
        Grand MasterGrand Master
        6,603548

          Jan 10, 2005#4

          Remove the space between the name of the macro file and the macro name, then it should work. If not, specify whole path to uedit32.exe in "" if it contains spaces ("C:\Program Files\UltraEdit\uedit32.exe").

          So try this

          start "C:\Program Files\UltraEdit\uedit32.exe" C:\pinginfo.txt /M,E,1="C:\Loz.MAC/CleanPE"

          If still not working, try to get start.exe from Windows 95. I also use start in some batch files and encountered problems with the NT versions (NT4, Win2000, WinXP) of it. Now I use start.exe from Win95 (size 9 kB) on all platforms and this one works fine.
          Best regards from an UC/UE/UES for Windows user from Austria

          1
          NewbieNewbie
          1

            Jan 10, 2005#5

            Lars,

            I was having a similar problem with this yesterday... using macros for the first time.

            For me, it worked *only* if ultraedit was *closed* before I ran it from the command line.

            This might have something to do with the preferences setting which is set to open all files in one running copy of uedit32. Maybe if it was set to open new files in a new process, then these problems wouldnt occur, but I havent tried that myself.

            Cheers,
            Linus

            2
            NewbieNewbie
            2

              Aug 15, 2005#6

              Hello, my first post here :)

              I have the same problem.
              Is there a way to start macros via command line when uedit is allready running in background?

              Still runnig v9.20

              greets

              6,603548
              Grand MasterGrand Master
              6,603548

                Aug 15, 2005#7

                For problems with windows start command see also my post at DOS script to start UltraEdit.

                To avoid problems with running a macro from command line while an instance of UltraEdit is already active, run UltraEdit with the macro AND with a special ini-file, also specified at command line. This ini-file could be a simple copy of existing uedit32.ini, but it is important that following setting exists in this ini-file:

                [Settings]
                Multiple Instances=1

                Example:

                The special ini-file for macro execution on command line is named uemacro.ini and stored in the program directory of UltraEdit, which is by default for English windows environment "C:\Program Files\UltraEdit". The command line is now:

                "C:\Program Files\UltraEdit\uedit32.exe" "Your file to modify.txt" /i="C:\Program Files\UltraEdit\uemacro.ini" /M,E,1="Your macro file with path/macro name"

                If you run this from a batch file with the start command, add start "UltraEdit" at the beginning of the command line above.
                Best regards from an UC/UE/UES for Windows user from Austria

                2
                NewbieNewbie
                2

                  Aug 15, 2005#8

                  Danke schön :)

                  4
                  NewbieNewbie
                  4

                    Jan 13, 2007#9

                    Hello,

                    I am using Uedit 12.20b and try to launch a macro via cmd-line.

                    Code: Select all

                    uedit32 /M="C:\Programme\UltraEdit\OpenAndInsert.mac/OpenAndInsert"
                    with this macro OpenAndInsert.mac:

                    Code: Select all

                    InsertMode
                    ColumnModeOff
                    HexOff
                    UnixReOff
                    "Testoutput"
                    But edit start with a blank window and nothing appears.
                    What do I miss?

                    6,603548
                    Grand MasterGrand Master
                    6,603548

                      Jan 13, 2007#10

                      When using the macro command line parameter UltraEdit assumes that it is used only in combination with at least 1 file opened too.

                      I THINK, on start of UltraEdit first all the settings in configurations files are loaded and applied, then the files are loaded, then the additional parameters on the command line are executed including your macro specification and last it checks if a file is open and if not it creates a new file if the config setting Create new EDIT file when opening with no other files is checked.

                      Try it with following macro:

                      InsertMode
                      ColumnModeOff
                      HexOff
                      UnixReOff
                      IfNameIs ""
                      NewFile
                      EndIf
                      "Testoutput"
                      Best regards from an UC/UE/UES for Windows user from Austria

                      4
                      NewbieNewbie
                      4

                        Jan 13, 2007#11

                        Mofi,

                        Thanks a lot, your macro works correctly.
                        Maybe it should be mentioned more specificly in the doc.

                        Hans-Peter