Run macro from command line and pass in strings to GetString

Help with writing and playing macros

Run macro from command line and pass in strings to GetString

Postby moonark » Tue Jan 06, 2009 11:00 pm

I have a macro that adds static text at the end of a file along with dynamic text using GetString. Is there a way to pass in the GetString values from the command line so UE does not prompt me?
moonark
Newbie
 
Posts: 1
Joined: Tue Jan 06, 2009 10:53 pm

Re: Run macro from command line and pass in strings to GetString

Postby Mofi » Wed Jan 07, 2009 5:03 am

No. For command line usage create a second macro which does not use GetString but gets the string from a file with fixed name which this alternate macro opens, reads and closes. Or copy the string to the Windows Clipboard before running UltraEdit with the alternate macro from the command line and paste the string from within the macro.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4037
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Run macro from command line and pass in strings to GetString

Postby jorrasdk » Wed Jan 07, 2009 5:54 am

Along the same lines as Mofis suggestion:

Install the small program clip.exe which can be used to place things in the windows clipboard from a command line or batch file.

Create a DOS batch file to invoke UE after putting the command line parameter on the windows clipboard:

Code: Select all
@echo %1 | clip
@uedit32 c:\temp\test.txt /m="c:\temp\macro.mac"


Then in your macro code, use
Code: Select all
Clipboard 0
Paste

to insert the parameterdata now on the windows clipboard.
User avatar
jorrasdk
Master
Master
 
Posts: 275
Joined: Mon Mar 19, 2007 11:00 pm
Location: Denmark

Re: Run macro from command line and pass in strings to GetString

Postby sklad2 » Wed Jan 07, 2009 1:29 pm

That clip utility is really cool!!!! I wish I had know about that along time ago.
User avatar
sklad2
Advanced User
Advanced User
 
Posts: 58
Joined: Thu Mar 08, 2007 12:00 am


Return to Macros