0

I need to record a macro which save the current file getting the name of the file from what I have on the clipboard. I know I can edit the macro after saving the file and use the "^c" variable, but this works only if you have in the clipboard the full path of the file and edit the macro like

Open "^c"

I need something like

SaveAs "C:/myfolder/"+^c+".txt"

But of course this doesn't work. How can I do this?

0

Not concatenating with plus worked for me:

InsertMode
ColumnModeOff
HexOff
UnixReOff
Find RegExp "tanana"
Replace All "blablabla"
CopyFilePath
SaveAs "^c_edited.txt"
CloseFile

This will keep the old extension of the file. I found a forum post for how to go about stripping the extension here: https://www.ultraedit.com/forums/viewtopic.php?f=10&t=268

(search for Mofi's post Nov 23 2004) But in my case I'm not bothered about it.

If you want to batch edit loads of text files you can use in cmd:

pathto\uedit32.exe pathtodata\*.txt /m,1000="pathtoueditmacro.mac" 

where 1000 would be your number of data files; make sure all files in UE are previously closed and all macros deleted from the list; then you could strip the double extension for all files using the bulk rename utility http://www.bulkrenameutility.co.uk/Main_Intro.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.