Jump to content
Macro Express Forums

acantor

Members
  • Posts

    1,534
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by acantor

  1. It is easy to semi-automate the process: you press a key -- let's use F12 -- to trigger the MX script, and it fixes one sentence. So you sit there are press F12 over and over again until the job is done. If it works, you can add a repeat, say, 20 or 50 or 1000 times with each key press. But let's simplify by trying to do one fix per key press: The script would look something like this: (Not tested) // Initiate find Text Type "<CONTROL>f" Text Type "<ENTER>" // Wait for Find dialog to appear Delay .25 // Search for the end of a sentence: period followed by space. Press Enter to start search... Text Type ". " Text Type "<ENTER>" // Dismiss dialog by pressing Esc Text Type "<ESC>" Delay .25 // Type over selection with the HTML... Text Type ".</p><ENTER><p>"
  2. It's easy to get conflicts with pre-existing hotkeys -- or even Macro Express macros -- when you choose to activate when keys are pressed rather than released. My guess about what is happening: when you press Ctrl + [, Macro Express thinks you want either Ctrl + Alt + [ or Ctrl + Alt + Tab. Neither is a built-in Windows command, but they could be application specific hotkeys. However, the other possibility is that you used Macro Express to make a macro triggered by one of these hotkeys. My experience has been that "key pressed" scripts usually fail when: 1. The scripts send hotkeys via the "Text Type" command; and 2. These hotkeys use modifier keys (Shift, Ctrl, or Alt). In other words, with key pressed macros, you are more likely to have success if you use "text type" to simulate alphanumeric keystrokes ("Hello!") rather than to send keystrokes ("<CONTROL>x"). By the way, be careful with cases. <CONTROL>x is not the same a <CONTROL>X. The latter might be interpreted as <SHIFT><CONTROL>x Finally, key pressed scripts seem to work OK when they send function keys rather than key combos that include modifiers. For example, you may not be able to simulate Alt + Tab, but you can probably simulate F10, F2, Insert, Page Up, etc.
  3. Try changing Window activation property "Window Gains Focus" to "Window is Opened." I am not sure of what the difference is, except that my commands that worked with the former in ME3 now seem to require the latter in ME4.
  4. Congratulations to Kevin, Stan, and everybody else at ISS on the release of Macro Express Pro v 4.0.3.1! Thank you for your hard work. The first thing I checked after downloading the new version was Window Title activation, which was unreliable in the previous releases. It seems OK now, but with one odd thing: Window title activation does not seem to work when the triggering event is set to "Window Gains Focus." However, it works fine (so far) when set to "Window is Opened."
  5. If Macro Express crashes -- it does not happen often, but it does happen with Pro, and it did happen with Version 3 -- and upon restart, Macro Express opens a blank macro file, there is usually an easier solution than messing with the backup files: Go to "File" menu, choose "Reopen...," and then choose the most recently opened macro file, which is almost always first on the list.
  6. It's an excellent catch, Terry! It appears to be a bug only in the comments that are associated with particular commands; I can't replicate the problem when inserting a Remark by itself.
  7. There is also the "Timed Delay in Seconds" and "Timed Delay in Milliseconds" commands, which apparently are easy on CPU and cannot be halted.
  8. When using Macro Express in tandem with RAM intensive programs (say, Dragon NaturallySpeaking), is it preferable to use a "wait for delay" instead of a normal "delay?" Is there a threshold (say, 25 ms, 1000 ms, 3000 ms, etc.) beyond which one can notice performance penalties from using one wait command over the other?
  9. Is it always necessary to use "Variable Save" and "Variable Restore" when passing values between macros? If so, under what conditions? I have not been saving and restoring variables, and perhaps this is the reason I have problems when "Main_Macro" runs "Sub_Macro." Does declaring the scope of a variable to "Local" and "Global" make a difference? In other words, if my macros are saving and restoring variable values, can "Main_Macro" access the value of the local variable evaluated in "Sub_Macro?"
  10. A few years ago while travelling in the German- and Italian-speaking parts of Switzerland, I used computers in public libraries to keep in touch. Slight differences in the layouts between Swiss keyboards and English Canadian/American keyboards made touch typing all but impossible. For example, Y and Z are switched. But as someone who normally does not need a mouse, the different Alt keys drove me bananas. The "normal" Alt key did what I expected: press and release to switch keyboard input focus between document and menu bar; and use as a modifier key for, say, Alt + F4. The "Alt Gr" key, on the other hand, seems to be a second level shift key: Shift + key inserts one symbol or accented letter, and Alt Gr + the same key inserts a different symbol or accented letter.
  11. I have written several case studies that describe ways that I have used Macro Express to deal with similar situations. Maybe one of these articles will give you ideas on how to accomplish what you are trying to do: Download and rename macro Path shortcut macro
  12. Hi Kevin, Please clarify. I create a macro called AAA. In it, I define a global variable %V%. I create a second macro, called BBB. It contains the following line: Macro Run: AAA Is this considered an example of a macro that calls another? And if yes, how to I access the value of %V% from within BBB?
  13. I am discovering that this may be a more general problem. My global Integer variables are not seen by other macros, either... For example, here is a script called "Variable Test" that checks a pixel colour, and then sets (1) global Boolean variable "IsTargetColour" and, for good measure, (2) global Integer variable "IsTargetColourInteger". Mouse Move: 500, 40 Relative to Current Window Get Pixel Color from Beneath the Mouse into %PixelColour% If Variable %PixelColour% Equals "12345678" Variable Set Bool %IsTargetColour% to "True" Variable Set Integer %IsTargetColourInteger% to 1 Else Variable Set Bool %IsTargetColour% to "False" Variable Set Integer %IsTargetColourInteger% to 0 End If I save the macro. When executed, it works. Then I create a second script called "Foo": Macro Run: Variable Test // When I insert the "If Variable" command, "IsTargetColour" and "IsTargetColourInteger" do not appear on the list of available variables // ----- Do this if TRUE Else // ----- Do this if FALSE End If So... what is wrong?
  14. I defined a boolean variable in one script and made it global. But when I try to use the variable in another script, Macro Express cannot find it. Instead, I get a message in the "Insert Variable" dialog box: "There are no variables of the required type defined" Can anybody duplicate this problem? Or am I missing something about variable handling?
  15. Ctrl + Tab and Shift + Ctrl + Tab work in many contexts to move between tabbed pages. Sometimes Ctrl + PageUp and Ctrl + PageDown are supported, as well.
  16. I requested this as a feature several years ago, but so far, it has not been implemented. But hope springs eternal! When I need to use the clipboard to copy information to a variable, I usually try to preserve the clipboard, and then restore the original clipboard after the variable is assigned. It only works when the clipboard contains text (not graphics) and all formatting is lost. Preserving and restoring the original clipboard also increases the runtime of the macro, but that's the trade-off. It is better than nothing!
  17. In the most recent release of Macro Express Pro, Insight removed several accelerator keys because they conflicted with others. So essentially, some of the hotkeys did not work as advertised. (Look back at Macro Express 3, and you will find many hotkey conflicts that were never resolved. ) The other option would have been to reassign some hotkeys. But with any complex application, it becomes difficult to find unique keys. At a certain point, you run out of keys, and the only way to keep everything working is for the developers to change the names of objects all over the application. That is not a good option, either. For almost everything that I access frequently in Macro Express, I create a macro. Most are activated by hotkeys, but some are triggered by ShortKeys and Window Titles. One of the best things about Macro Express is that you can create macros to make it work the way you need it to!
  18. I reported this as a bug, and received the following message today: Issue [iSS6780] submitted by you has been resolved. The change will be available with the next release of Macro Express Pro. Description of issue [iSS6780]: -------------------------------------------------------------- Macro Express Pro - Window title activation fails sporadically the first time a window appears. Window title activation fails sporadically the first time a window appears. For example, a macro activated by "XXX" fails when XXX first opens, but works after focus is given to another window, and then returned to XXX. --------------------------------------------------------------
  19. I found several algorithms on line for calculating the day of the week for any date. For fun, I tried to implement one of solutions in Macro Express. It's challenging -- I am not a professional programmer, there are many variables to keep track of, and there a number of special cases that need to be dealt with -- but I think the algorithm is do-able. I will post my solution if I succeed. But one aspect of the coding is a little beyond me. Can someone help? Let's say there are two decimal variables, %D1% and %D2%. In Macro Express, how do I code %D1% mod %D2%? I have not studied math in over 30 years, and my recollection is that mod has to do with the remainder? Or the numbers after the decimal point?
  20. Sometimes a macro that does part of the job is better than not having a macro at all! Here is a partial solution. It does not calculate the day of the week -- a task I leave to greater minds. But converting dd/mm/yy to d mmmm yyyy was straightforward. It took only an hour or so to get it to work, including its rudimentary validation checks. This macro could be easily be modified to type out the date, and then move the cursor back to where you want the day of the week inserted! // Convert DD/MM/YY to D MMMM YYYY // NumericDate = Date as DD/MM/YY Variable Set String %NumericDate%: Prompt // Validation 1: Is NumericDate eight characters long? If not, quit. Variable Set Integer %StringLength% to the length of variable %NumericDate% If Variable %StringLength% Does not Equal "8" Text Box Display: Validation problem: Wrong number of characters Macro Stop End If // Validation 2: Check for / in positions 3 and 6. If one or both are missing, quit. Variable Set String %FindForwardSlash% to "%NumericDate%" Variable Modify String %FindForwardSlash%: Delete a substring starting at 1 and 2 characters long Variable Modify String %FindForwardSlash%: Delete a substring starting at 2 and 2 characters long Variable Modify String %FindForwardSlash%: Delete a substring starting at 3 and 2 characters long If Variable %FindForwardSlash% Does not Equal "//" Text Box Display: Validation problem with slashes Macro Stop End If // Split NumericDate in three with / as separator Split String "%NumericDate%" on "/" into %DatePiece%, starting at 1 // DatePiece[1] = Day of Week // If it starts with a zero, remove the zero. E.g., "09" becomes "9" If Variable %DatePiece[1]% Is Less Than "9" Variable Modify String %DatePiece[1]%: Delete a substring starting at 1 and 1 characters long End If // Change numeric month to alphabetical month... // DatePiece[2] = Month Switch( %DatePiece[2]% ) Case: 01 Variable Set String %DatePiece[2]% to "January" End Case Case: 02 Variable Set String %DatePiece[2]% to "February" End Case Case: 03 Variable Set String %DatePiece[2]% to "March" End Case Case: 04 Variable Set String %DatePiece[2]% to "April" End Case Case: 05 Variable Set String %DatePiece[2]% to "May" End Case Case: 06 Variable Set String %DatePiece[2]% to "June" End Case Case: 07 Variable Set String %DatePiece[2]% to "July" End Case Case: 08 Variable Set String %DatePiece[2]% to "August" End Case Case: 09 Variable Set String %DatePiece[2]% to "September" Case: 10 Variable Set String %DatePiece[2]% to "October" End Case Case: 11 Variable Set String %DatePiece[2]% to "November" End Case Case: 12 Variable Set String %DatePiece[2]% to "December" End Case Default Case // Validation 3: Month must be 01 - 12 Text Box Display: Validation problem: Month is incorrect. Macro Stop End Case End Switch // DatePiece[3] = Year // For 00 - 50, assume 21st century // For 51 - 99, assume 20th century If Variable %DatePiece[3]% Is Less Than "50" Variable Set String %DatePiece[3]% to "20%DatePiece[3]%" Else Variable Set String %DatePiece[3]% to "19%DatePiece[3]%" End If Text Box Display: Result <COMMENT Value="Convert DD/MM/YY to D MMMM YYYY"/> <COMMENT Value="NumericDate = Date as DD/MM/YY"/> <VARIABLE SET STRING Option="\x01" Destination="%NumericDate%" Prompt="Enter date as DD/MM/YY" Mask="FALSE" OnTop="FALSE" Left="Center" Top="Center" Monitor="0"/> <COMMENT Value="Validation 1: Is NumericDate eight characters long? If not, quit."/> <VARIABLE SET INTEGER Option="\x0D" Destination="%StringLength%" Text_Variable="%NumericDate%"/> <IF VARIABLE Variable="%StringLength%" Condition="\x01" Value="8" IgnoreCase="FALSE"/> <TEXT BOX DISPLAY Title="Validation problem: Wrong number of characters" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang4105{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 Date must be in this format: dd/mm/yy\\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"/> <MACRO STOP/> <END IF/> <COMMENT Value="Validation 2: Check for / in positions 3 and 6. If one or both are missing, quit."/> <VARIABLE SET STRING Option="\x00" Destination="%FindForwardSlash%" Value="%NumericDate%"/> <VARIABLE MODIFY STRING Option="\x0A" Destination="%FindForwardSlash%" Start="1" Count="2"/> <VARIABLE MODIFY STRING Option="\x0A" Destination="%FindForwardSlash%" Start="2" Count="2"/> <VARIABLE MODIFY STRING Option="\x0A" Destination="%FindForwardSlash%" Start="3" Count="2"/> <IF VARIABLE Variable="%FindForwardSlash%" Condition="\x01" Value="//" IgnoreCase="FALSE"/> <TEXT BOX DISPLAY Title="Validation problem with slashes" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang4105{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 Date must be in this format: \r\n\\par \r\n\\par dd/mm/yy\\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"/> <MACRO STOP/> <END IF/> <COMMENT Value="Split NumericDate in three with / as separator"/> <SPLIT STRING Source="%NumericDate%" SplitChar="/" Dest="%DatePiece%" Index="1"/> <COMMENT Value="DatePiece[1] = Day of Week"/> <COMMENT Value="If it starts with a zero, remove the zero. E.g., \"09\" becomes \"9\""/> <IF VARIABLE Variable="%DatePiece[1]%" Condition="\x02" Value="9" IgnoreCase="FALSE"/> <VARIABLE MODIFY STRING Option="\x0A" Destination="%DatePiece[1]%" Start="1" Count="1"/> <END IF/> <COMMENT Value="Change numeric month to alphabetical month..."/> <COMMENT Value="DatePiece[2] = Month"/> <SWITCH Variable="%DatePiece[2]%"/> <CASE Value="01"/> <VARIABLE SET STRING Option="\x00" Destination="%DatePiece[2]%" Value="January"/> <END CASE/> <CASE Value="02"/> <VARIABLE SET STRING Option="\x00" Destination="%DatePiece[2]%" Value="February"/> <END CASE/> <CASE Value="03"/> <VARIABLE SET STRING Option="\x00" Destination="%DatePiece[2]%" Value="March"/> <END CASE/> <CASE Value="04"/> <VARIABLE SET STRING Option="\x00" Destination="%DatePiece[2]%" Value="April"/> <END CASE/> <CASE Value="05"/> <VARIABLE SET STRING Option="\x00" Destination="%DatePiece[2]%" Value="May"/> <END CASE/> <CASE Value="06"/> <VARIABLE SET STRING Option="\x00" Destination="%DatePiece[2]%" Value="June"/> <END CASE/> <CASE Value="07"/> <VARIABLE SET STRING Option="\x00" Destination="%DatePiece[2]%" Value="July"/> <END CASE/> <CASE Value="08"/> <VARIABLE SET STRING Option="\x00" Destination="%DatePiece[2]%" Value="August"/> <END CASE/> <CASE Value="09"/> <VARIABLE SET STRING Option="\x00" Destination="%DatePiece[2]%" Value="September"/> <CASE Value="10"/> <VARIABLE SET STRING Option="\x00" Destination="%DatePiece[2]%" Value="October"/> <END CASE/> <CASE Value="11"/> <VARIABLE SET STRING Option="\x00" Destination="%DatePiece[2]%" Value="November"/> <END CASE/> <CASE Value="12"/> <VARIABLE SET STRING Option="\x00" Destination="%DatePiece[2]%" Value="December"/> <END CASE/> <DEFAULT CASE/> <COMMENT Value="Validation 3: Month must be 01 - 12"/> <TEXT BOX DISPLAY Title="Validation problem: Month is incorrect." Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang4105{\\fonttbl{\\f0\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 Month %DatePiece[2]% must be between 1 and 12\r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <MACRO STOP/> <END CASE/> <END SWITCH/> <COMMENT Value="DatePiece[3] = Year"/> <COMMENT Value="For 00 - 50, assume 21st century"/> <COMMENT Value="For 51 - 99, assume 20th century"/> <IF VARIABLE Variable="%DatePiece[3]%" Condition="\x02" Value="50" IgnoreCase="FALSE"/> <VARIABLE SET STRING Option="\x00" Destination="%DatePiece[3]%" Value="20%DatePiece[3]%"/> <ELSE/> <VARIABLE SET STRING Option="\x00" Destination="%DatePiece[3]%" Value="19%DatePiece[3]%"/> <END IF/> <TEXT BOX DISPLAY Title="Result" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang4105{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 %DatePiece[1]% %DatePiece[2]% %DatePiece[3]%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>
  21. Try changing the hotkey for terminating the running macro, and pressing it instead of the default hotkey. (I have reassigned it to the "Pause" key.) This works reliably for me.
  22. Wow! It works... I mean, it doesn't work. I recreated your macro, held down Alt + X for less than a second, and saw a dozen or more instances of the dialog appear. Then MEP crashed. You should definitely report this bug!
  23. I don't think it is possible to map the Print Screen key to a Macro Express macro, but you can do the opposite: Choose another hotkey to simulate pressing Print Screen or Alt + Print Screen.
  24. Try disabling all ShortKey macros that start with M but one, and see if the problem disappears. I suspect there will be no problem with only one macro. Gradually reintroduce your macros, and see if you can figure out the source. My guess is that you cannot have plain "M" as a shortkey if you have other Shortkeys that start with M. I am quite sure that this is true for prefix Shortkeys in general. I don't think it holds for suffix Shortkeys. Hint: Consider changing the prefix to something easier to type: my two favourite prefixes are "q" and comma. Comma is great because no Shift key required; no words start with the comma; and even "bad" touch typists can usually hit it without looking at the keyboard. I once used Q as a prefix for a person who typed only with their left hand.
  25. Do you have any activations that start with the letter "m?"
×
×
  • Create New...