kunkel321 Posted December 25, 2008 Report Share Posted December 25, 2008 Hi All, I didn't try to do the "Import old macros" option, I just located my ME3 file on my computer and opened it in MEpro. IT seems to have worked fine, but I have noted that as a safety precaution MEpro has inserted "Lock player" and "Unlock" commands at the beginning and ending of each macro. I read in one of the other posts that there is a potential for a conflict if 2 macros are simultaneously sending info to the key-que. I guess there is probably an unlimited number of possible scenarios for conflict, since ME can manipulate *so many* of the Windows OS functions. I'm not an expert, but I suppose any time you try to do two different things to the same file, application, or process at the same time, one of two things will happen: 1. One of the macros won't work; or 2. There will be a crash somewhere. I'm hoping some of our local experts can expand on this... What are the mostly likely scenarios for conflict? When are the Lock/Unlock commands definitely NOT needed in a macro? What are some examples of cases where folks have used the lock? Thanks. -steve Quote Link to comment Share on other sites More sharing options...
kevin Posted December 26, 2008 Report Share Posted December 26, 2008 Windows only allows keystrokes, mouse movements and mouse clicks within one window, the one with focus. Any macro that opens a program, activates a window or changes the window that has focus could cause problems if runs while another macro is running. The Unlock Player and Lock Player commands avoid those problems. If your macro is checking, copying or deleting files you are probably safe, unless another macro is depending on one of the affected files. The general rule should be to think when writing your macros "What would happen if another macro started running right here?" If there is a potential for problems you should add Lock Player and Unlock Player commands. When Macros are converted from Macro Express 3, the Lock Player and the Unlock Player commands are added to the top and bottom of the macro, respectively. But it is not required that they be at the top and bottom. You can add them anywhere in your macro. For example: // Do macro commands like copy files, initializing variables and getting things ready for the macro to run. Lock Player: Wait for running macros to stop // About to enter a critical section If Not Window "Notepad" is focused Activate or Launch: Window "Notepad", Program "notepad.exe", Parameters "" End If Text Type (Simulate Keystrokes): This text will be typed into Notepad ... Unlock Player // Done with the critical section // // Do more macro commands that do not depend on a specific window having focus. // Lock Player: Wait for running macros to stop // About to enter a critical section If Not Window "Notepad" is focused Activate or Launch: Window "Notepad", Program "notepad.exe", Parameters "" End If Mouse Move: 123, 456 Relative to Current Window Mouse Left Click: 123, 456 Relative to Current Window Text Type (Simulate Keystrokes): This text will be typed into Notepad ... Unlock Player // Done with the critical section 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.