Jump to content
Macro Express Forums

Global Search/Replace


Recommended Posts

I just upgraded from QuickBooks 2007 to 2010 and have about 60 macros that have the window title "Quickbooks 2007" embedded in them. I'd like to change them all to "QuickBooks 2010".

 

Is there some combination of import/export or some other kind of global search/replace I can use to fix everything all at once?

Link to comment
Share on other sites

I just upgraded from QuickBooks 2007 to 2010 and have about 60 macros that have the window title "Quickbooks 2007" embedded in them. I'd like to change them all to "QuickBooks 2010".

 

Is there some combination of import/export or some other kind of global search/replace I can use to fix everything all at once?

 

I'd personally first try a hex editor like Hex Workshop from http://www.bpsoft.com/downloads/

I'm no programmer but I've successfully used its Replace facility on MEX in similar situations. The crucial requirement appears to be that the Find and Replace strings should be identical in length. Happily that's true in your proposed case. (I'm sure someone more familiar with binary files could do it with unequal strings too. I'd appreciate a primer if so!)

 

I suspect it's confidential, but if not you could alternatively email the MEX to terrypin@dial.pipex.com and I'll send you a revised version to try.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

I put this issue in a request for feature to ISS. It's ugly right now. I have some macros that will go through all the macros in a macro file and do "search and replace" or "find and announce for edit". Unfortunately they are very ugly* to use and time-consuming since the Script Editor is needed for every macro. The Find is particularly annoying because you get the System "clunk" every time a string is not found (I can't turn down the volume since I have other sounds for "found" and "done").

 

* by ugly I mean time-wise and the macro uses the ME shortcuts Alt+S and Ctr+F4 so you have to ensure no macros in the macro file being edited use those as hotkeys.

 

As reported in other posts, although a lot of plain text is visible in the mex files, much of it is truncated so you can't directly edit in a reliable fashion.

 

Given the abscence of Global functions, MEPro itself does not make life easy. The keyboard shortcuts in ME3 (such as navigating between panes) seem to have disappeared. It is not easy to navigate Macro Explorer and Script Editor. Also, the one place it is difficult to use Controls is in Script Editor itself! For example to detect the Find "not found" window you cannot Get Control because the Find dialogs disappear when you program Get Control. You have to use Capture Control instead.

 

My recent post about the Script Editor closing causing all running macros to stop, forced me to changed my Global macros. It turned out for the best. I used to edit a macro, close the Script Editor and select the next macro in the list for processing. I now open all macros in the Script Editor first and process one at a time, closing the tab after the edit. This is much quicker than closing the Script Editor each time (which takes a loooong time to disappear). I thought there may be a limit to numbers but I've done up to 90 macros at a time.

 

(Edit) I was thinking about this yesterday. I'm sure the pros set up their macros so that all common information is in environment variables, text files, ini files and the registry. That way there is no need to update the macros. You may want to consider the same. Put the the name "Quickbooks.." in a text file. Read the "Quickbooks.." from there into a text variable at the start of the macro and use that variable instead of the name. Ditto for any other stuff you use that may be changed by outside influences.

 

Another area which is a nuisance is adding a universal macro to every macro file. Perhaps someone has a good way of doing that? I have a setup which makes the manual work easier. I may try to automate fully some time.

Edited by JohnS
Link to comment
Share on other sites

I now open all macros in the Script Editor first and process one at a time, closing the tab after the edit. This is much quicker than closing the Script Editor each time (which takes a loooong time to disappear).

Thanks for the tip, John. I'm going through the same thing now -- multiple iterations of importing several dozen ME3 macros to MEP, then using a macro to apply a set of edits to each of the imports. Your method will be a time saver.

Link to comment
Share on other sites

Great tip Terry! That worked perfectly. I'm all set.

 

I used HxD Editor (free). While Hex Workshop may be more feature rich, it's also $90. :)

 

Thanks again for the quick reply and good advice.

 

Jace

 

I'd personally first try a hex editor like Hex Workshop from http://www.bpsoft.com/downloads/

I'm no programmer but I've successfully used its Replace facility on MEX in similar situations. The crucial requirement appears to be that the Find and Replace strings should be identical in length. Happily that's true in your proposed case. (I'm sure someone more familiar with binary files could do it with unequal strings too. I'd appreciate a primer if so!)

 

I suspect it's confidential, but if not you could alternatively email the MEX to terrypin@dial.pipex.com and I'll send you a revised version to try.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

I try to save as many things like this outside the macro.

.........................................................

On my first major distributed macro I had to make a change like this and from then on I make every effort to save in the INI file for distributed things like the location of a file repository. I also make use of the Macro File command to get the location of the MEX file where I create a package of goodies to go with the macro like INI files. This is also useful for developmental testing and portability. But locally I use the registry but I have a macro that runs at startup and verifies and enforces several settings and if one is missing like setting their version of Outlook I prompt them for it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...