Always get error message when running a macro/script via command line parameter

Help with writing and playing macros

Always get error message when running a macro/script via command line parameter

Postby grantz » Tue May 05, 2009 2:14 pm

On a Windows XP SP3 system, I am trying to get a command line invocation of UltraEdit from a batch file and I can't seem to get it right. Here is myline -
Code: Select all
Start "UltraEdit the Model offline" "C:\Program Files\IDM Computer Solutions\UltraEdit\Uedit32.exe" "O:\ReportNet\FrameWork\Population Star Schema\JAGmodel.xml" /m="C:\My Commands\My XML Format.mac"

When I run this I get
"C:\Program Files\IDM Computer Solutions\UltraEdit=C:\My Commands\My XML Format.mac contains an incorrect path."

The macro is where I pointed "C:\My Commands" and I checked the spelling a dozen times..

The editor starts correctly and the file specified (JAGmodel.xml) is loaded but the macro is not run. I have read the document
"Run a macro or script from the command line"
and thought I followed it right, but no luck.

By the way, the macro contains the following:
Code: Select all
InsertMode
ColumnModeOff
HexOff
XMLConvertToCRLF
ReIndentSelection

Thanks again for your patience and your help.
grantz
Newbie
 
Posts: 2
Joined: Fri Apr 24, 2009 8:02 am

Re: Always get error message when running a macro/script via command line parameter

Postby Mofi » Wed May 06, 2009 2:29 am

Use following command line (one line!):

Start "UltraEdit the Model offline" "C:\Program Files\IDM Computer Solutions\UltraEdit\Uedit32.exe" /fni "O:\ReportNet\FrameWork\Population Star Schema\JAGmodel.xml" /m="C:\My Commands\My XML Format.mac"

/fni - Force New Instance must be the first parameter.

I have already sent a few days ago an email to IDM with the suggestion to automatically implicit /fni when UltraEdit is started with the command line option /m or /s because it is impossible to pass the command line parameters to an existing instance of UltraEdit when a macro or script should be executed.

The existing instance have maybe already files open, the opened files could be modified and not saved, a macro file different to the one which should be executed could be already loaded in this instance, or the existing instance even executes currently a macro or a script or a user tool. So if a user has not enabled the configuration setting Allow multiple instances the macro or script execution must be done in a new instance.

But the users often don't know all these facts and therefore don't specify the /fni parameter and the result is what you see when an UltraEdit instance is already running. I'm sure your command line works if no UltraEdit is running. I hope that in one of the next future versions an explicit /fni is not needed anymore when the command line contains /m or /s.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4055
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Always get error message when running a macro/script via command line parameter

Postby grantz » Wed May 06, 2009 8:12 am

Thank you. It worked of course. :wink: I never would have come up with that.
grantz
Newbie
 
Posts: 2
Joined: Fri Apr 24, 2009 8:02 am

Re: Always get error message when running a macro/script via command line parameter

Postby pietzcker » Wed May 06, 2009 8:56 am

Wow. Subtle.
User avatar
pietzcker
Master
Master
 
Posts: 241
Joined: Sun Aug 22, 2004 11:00 pm


Return to Macros