Linda Posted July 13, 2004 Report Share Posted July 13, 2004 Hi! I couldn't find anything about this in the help-file. Is there a find-and-replace function in the MacroExpress editor? For instance, if I have a file with 50 references to %T9% and I want to change them all to %T55%, is there a way to do that without changing each one individually? Thanks, Linda Quote Link to comment Share on other sites More sharing options...
floyd Posted July 13, 2004 Report Share Posted July 13, 2004 Linda, Only the Direct Editor has the "Find and Replace" feature. Quote Link to comment Share on other sites More sharing options...
Linda Posted July 13, 2004 Author Report Share Posted July 13, 2004 Ah thanks! I'd forgotten about the Direct Editor screen because the formating was so ugly but that doesn't matter for large scale search and replace. But is it possible to get the Direct Editor to pretty-print (er, pardon the C++ term) on the screen? When I try to improve the formatting by adding <return> statements, they show up as wierd text things in the Scripting Editor. Is there anyway to add whitespace to the Direct Editor to make it readable without obfuscating the code from the Scripting Editor view? Thanks again, Linda Quote Link to comment Share on other sites More sharing options...
joe Posted July 13, 2004 Report Share Posted July 13, 2004 Hello Linda! When you view a macro in the Direct Editor, or any text editor, you are looking at it in its natural state. This is the macro. When viewing it from the Scripting Editor, you are seeing a more friendly, human representation. But, it is not the real thing. So, the Scripting Editor is actually the "pretty-print" interface that you referenced. You cannot add formatting to the Direct Editor. Remember that each editor is looking at the same macro in two different ways. When you make a change in one, it will appear in the other (if you save the change). Also, just so you know, you can use an external text editor. But again, you will be working with the macro in its natural state. Quote Link to comment Share on other sites More sharing options...
deezin Posted October 3, 2005 Report Share Posted October 3, 2005 Hi there. I am curious too. Is there any way to do a large scale find and replace. I believe that the Direct Editor Screen is just for one find and replace....and I need to find a word that is repeated about 100 times in a document and deleting that word. Is there a way to do that? Thanks. Rachel Quote Link to comment Share on other sites More sharing options...
paul Posted October 4, 2005 Report Share Posted October 4, 2005 I believe that the Direct Editor Screen is just for one find and replace....and I need to find a word that is repeated about 100 times in a document and deleting that word. Is there a way to do that? The Direct Editor has a "Replace All" button! Quote Link to comment Share on other sites More sharing options...
deezin Posted October 5, 2005 Report Share Posted October 5, 2005 Thanks. I am very much confused I think. It seems to me that the search all screen is just to search the script within MacroExpress....however, I want to search a Word Document for a specific word and replace it with another....however, I want to do this on a large scale. Can anybody step me through this process or point me to the correct tutorial for doing this? Thank you...I really want to buy this software...it seems like amazing programming. Thank you!! Quote Link to comment Share on other sites More sharing options...
kevin Posted October 5, 2005 Report Share Posted October 5, 2005 The way to do this is to write a macro that uses MS Word to open a document, perform the search and replace, save, close and repeat with the next document. Quote Link to comment Share on other sites More sharing options...
deezin Posted October 6, 2005 Report Share Posted October 6, 2005 Dear Kevin. Thank you for your post. I just ordered macros Express and the Library with Codes. I was hoping that there would be an example of the search feature within the library. I just completed the entire tutorial and none of the examples explained how to find and replace. I don't need the macro to open up a word file and save it and close the file...I can just click on a hotkey while I am in the document...I only need it to find and replace. Can you please tell me what the coding would be...I am so sorry, I just can't figure it out. I basically want it to search and replace all words that say 'address' and delete it (or find address and replace it with nothing), find all words that say 'school' and delete it, and find all words that say 'web' and delete it. Is there already an example from the library code that I purchased that I can work with to do something similar to this? Or can you write up a quick example for me? Thank you!!!!! Rachel Quote Link to comment Share on other sites More sharing options...
kevin Posted October 6, 2005 Report Share Posted October 6, 2005 Rachel, What you want is the MS Word keystrokes to do a Search and Replace. In Word you would do the following to replace 'address' with an empty string: - Type Ctrl+f to bring up the Find dialog. - Type Alt+p to select the Replace tab. - Type 'address' in the 'Find what' field. - Type tab to move to the 'Replace with' tab. - Type the delete key to remove whatever is in the 'Replace with' field. - Type Alt+a to 'Replace All'. What Macro Express does it to automate what you normally type by hand. Here is an untested macro: Text Type: <CONTROL>f Delay 0.25 Seconds Text Type: <ALT>p Delay 0.1 Seconds Text Type: address Text Type: <TAB> Delay 0.1 Seconds Text Type: <DELETE> Delay 0.1 Seconds Text Type: <ALT>a Note the Delay commands between some of the commands. When you press Ctrl+f for example, it may take a moment for Word to bring up the Find/Replace dialog. As I mentioned, I have not tested this. You may need to experiment a bit to get it to work smoothly for you. Another alternative is to Capture a macro. When you Capture a macro you have the option to include the amount of time you take between keystrokes. This may be the most reliable but the macro will run more slowly than a macro written with the Scripting Editor. You might want to set the Scope so this macro only runs when MS Word is running. There might be a shortcut to bring up the Replace dialog. The command may be Alt+p but that is not working for me. You may want to search your MS Word help file to determine the shortcut. If there is a shortcut that brings up the Replace dialog you should be able to simplify the sample macro shown above. Quote Link to comment Share on other sites More sharing options...
deezin Posted October 6, 2005 Report Share Posted October 6, 2005 You are a genious! Thank you ... it works perfectly. :-) I run a large site for designers and another big one for freelancers and I am going to make sure that we recommend your macros on the site. Thank you!!!!!!!!! Quote Link to comment Share on other sites More sharing options...
Lars_Sandberg Posted October 12, 2005 Report Share Posted October 12, 2005 What you want is the MS Word keystrokes to do a Search and Replace Hi, I must say that MS Word is just about the worst tool for the job, sorry for the expression :-) For that I use UltraEdit, a superb ascii-editor ( www.ultraedit.com ). In UE which have an internal macro language, I have made few hot-keys, that temporarely changes following code example: <SPMSE:00060><SPKEY:0040><MMW2:132,32><LCLK><MMW2:172,146><LCLK><MMW2:320,79><LCLK><TEXTTYPE:<HOME><DOWN ARROW><DOWN ARROW><ENTER>><MMW2:292,160><LCLK> to: <SPMSE:00060> <SPKEY:0040> <MMW2:132,32> <LCLK> <MMW2:172,146> <LCLK> <MMW2:320,79> <LCLK> <TEXTTYPE:<HOME> <DOWN ARROW> <DOWN ARROW> <ENTER>> <MMW2:292,160> <LCLK> and back again so ME takes the code directly. When the code in UE have CR/LF's this can be processed in many ways besides just replace all etc. If anyone are interested I will post the UE macro file for handling ME Direct Code, which so far have following features: CRTL-1 Makes multilines CRTL-2 Make One line CRTL-3 Convert LMBD LMBU to LMBclick CRTL-4 Remove all Delays CRTL-5 Convert Delay (sec) to Timed Delay (0 cpu) CRTL-6 Convert Delay (msec) to Timed Delay (0 cpu) best regards Lars Quote Link to comment Share on other sites More sharing options...
kevin Posted October 12, 2005 Report Share Posted October 12, 2005 Rachel said: I want to search a Word Document for a specific word and replace it with another Can UltraEdit read and edit Word Document format files? It seems that Linda's requirements differ from Rachel's. Thank you Lars for pointing out that Word is not what Linda would want to use. Quote Link to comment Share on other sites More sharing options...
Lars_Sandberg Posted October 12, 2005 Report Share Posted October 12, 2005 Hi Kevin Can UltraEdit read and edit Word Docuement format files? No, UE is an ascii/ binary/ hex-editor, so a MS Word document, would propably become corrupt after such attempt :-) And sorry, I didn't notice Rachel's question reg MS Word files. regards Lars Quote Link to comment Share on other sites More sharing options...
kevin Posted October 12, 2005 Report Share Posted October 12, 2005 Thanks for pointing out that the requirements are different. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.