terrypin Posted August 8, 2016 Report Share Posted August 8, 2016 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-Simplified.mex Quote Link to comment Share on other sites More sharing options...
terrypin Posted August 8, 2016 Author Report Share Posted August 8, 2016 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 Quote Link to comment Share on other sites More sharing options...
rberq Posted August 8, 2016 Report Share Posted August 8, 2016 Clever work-around. But I have no answer to your original question. Quote Link to comment Share on other sites More sharing options...
acantor Posted August 9, 2016 Report Share Posted August 9, 2016 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. Quote Link to comment Share on other sites More sharing options...
terrypin Posted August 10, 2016 Author Report Share Posted August 10, 2016 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 agoA 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 Quote Link to comment Share on other sites More sharing options...
Samrae Posted August 10, 2016 Report Share Posted August 10, 2016 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. Quote Link to comment Share on other sites More sharing options...
terrypin Posted August 10, 2016 Author Report Share Posted August 10, 2016 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 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.