Jump to content
Macro Express Forums

Find/Replace puzzle


Recommended Posts

I'm about to give up on this after several hours. My macro opens a macro (selected in Explorer) in the Script Editor. It then opens the Find/Replace dialog using Ctrl+r. But as soon as it text types a string in the Find box, I get an error message telling me the text can't be found. Leave aside the fact that the string does exist in the target macro. But this error message is displayed before the command to Find (or Replace) the string is even reached!

 

I've done this sort of thing successfully in the past on my XP PC so I suspect it's a Win 10 issue. Anyone able to reproduce please, on 10, 8 or 7? I've attached a simple MEX.

 

Find-Replace-Puzzle.jpg

Find-Replace-Simplified.mex

Link to comment
Share on other sites

I'd still like to understand why the above doesn't work. But I have now achieved my objective by an alternative method. My revised macro copies the macro code to a variable and makes the various replacements required.

 

Terry, East Grinstead, UK

Link to comment
Share on other sites

1. Add delays between the steps to try to isolate the problem.

 

2. Or use an alternative way to navigate to the "Find What" field, perhaps something like this:

 

Ctrl + r ' Invoke Replace dialog

Wait 500 ms

Alt + c ' Landmark on the "Match Case" checkbox

Alt + c ' Restore the original value

Wait 500

Type "c:\docs"

Etc.

 

3. Use controls to navigate to and around the fields and buttons.

Link to comment
Share on other sites

Thanks Alan. There seems to be something else going on that is muddying the water. If I assign a hotkey (any of several) to this particular macro, and set Scope so that MacExp.exe must be on top (which of course it is when I have just selected a macro in Explorer) then nothing happens. No activation. But F9 from the Script Editor works.

 

Even with the macro revised to a single TBD this remains true.

<TEXT BOX DISPLAY Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 'Change path...' is running.\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>

EDIT:

Following up on my post of about 7 hours ago

A work around I found is to set scope to the window 'Macro Express Pro - Explorer', removing the program setting of MACEXP.EXE. I don't see why, but happy that it works.

My tentative conclusion is that there's some obscure conflict if you use an activation hotkey AND scope to the program MACEXP.EXE. Maybe other activation methods too; I haven't pursued that. And perhaps this is a Win 10 only issue; I haven't tested that either.

To test, with Macro Explorer active, try running a one line TBD macro with any hotkey activation, with scope set to:
1. Global. (Works here.)
2. Program = 'MACEXP.EXE' (Fails here.)
3. Window = 'Macro Express Pro - Explorer', Exact (Works here.)

I'll shortly see if this resolves the original subject problem.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

If I assign a hotkey (any of several) to this particular macro, and set Scope so that MacExp.exe must be on top (which of course it is when I have just selected a macro in Explorer) then nothing happens. No activation.

MacExp.exe is the process for the Macro Express Pro - Player.

MacEdit.exe is the process for Macro Express Pro - Explorer.

MacScript.exe is the process for the Macro Express Pro - Script Editor.

 

If you are setting the scope of a macro to only run when MacExp.exe is on top it will never run. This process is always hidden. It can never be on top or have focus.

 

Try setting the scope to MacEdit.exe or MacScript.exe depending on which process your macro is written for.

Link to comment
Share on other sites

Thanks Samrae. As per my edit in my earlier post I settled on using the Explorer window, which works reliably.

 

But from your post it seems I was using the wrong 'Running process', Macexp.exe, which, from its name, I assumed related to 'Macro Express Explorer'.

 

Terry, East Grinstead, UK

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...
 Share

×
×
  • Create New...