Jump to content
Macro Express Forums

Samrae

Members
  • Content Count

    398
  • Joined

  • Last visited

  • Days Won

    20

Everything posted by Samrae

  1. First check your Shortkeys playback settings found in the Shortkey preferences. What program are you typing into? If you are using Edge try a different browser. If that fixes the problem then download the Chromium based Edge.
  2. There is another example of using the ASCII Text File Process command in the samples.mex macro file. This file should be located somewhere in your My Documents folder. You can also copy it from the folder where the Macro Express Program files is installed (do not try to use it from the Program Files folder). C:\Program Files (x86)\Macro Express Pro 6\samples.mex Or, you can download it from this page: Sample Macros Look for the macro "Process a CSV Delimited File".
  3. You could also try adding a "Wait for File to be Ready" command in front of the Delete File/Files command: Lock Player Text Type (Simulate Keystrokes): <ALT>fl Delay: 1000 milliseconds Wait for File to be Ready: C:\Web\n1\generated\files-are-okay.txt Delete File/Files: "C:\Web\n1\generated\files-are-okay.txt" Delay: 250 milliseconds Window Activate: Mozilla Firefox Wait for Window Title: Mozilla Firefox Text Type (Simulate Keystrokes): <CONTROL>4 Delay: 500 milliseconds Text Type (Simulate Keystrokes): <CONTROL><F5> // Use <CONTROL><F5> to refresh browser fully. Delay: 500 milliseconds Unlock Player Text Type (Simulate Keystrokes): <LOCK PLAYER Wait="FALSE"/> <TEXT TYPE Action="0" Text="<ALT>fl"/> <DELAY Flags="\x12" Time="1000"/> <WAIT FOR FILE TO BE READY Filename="C:\\Web\\n1\\generated\\files-are-okay.txt" Time="1" Indefinite="FALSE" Hours="0" Minutes="0" Seconds="15"/> <DELETE FILE/FILES Path="C:\\Web\\n1\\generated\\files-are-okay.txt" Progress="FALSE" Recurse="FALSE" Permanent="TRUE"/> <DELAY Flags="\x12" Time="250"/> <WINDOW ACTIVATE Title="Mozilla Firefox" Exact_Match="FALSE" Wildcards="FALSE" _IGNORE="0x0006"/> <WAIT FOR WINDOW TITLE Title="Mozilla Firefox" Partial="TRUE" Wildcards="FALSE" Indefinite="FALSE" Hours="0" Minutes="0" Seconds="10"/> <TEXT TYPE Action="0" Text="<CONTROL>4"/> <DELAY Flags="\x12" Time="500"/> <TEXT TYPE Action="0" Text="<CONTROL><F5>" _COMMENT="Use <CONTROL><F5> to refresh browser fully."/> <DELAY Flags="\x12" Time="500"/> <TEXT TYPE Action="0" Text="<HOME>" _ENABLED="FALSE"/> <UNLOCK PLAYER/> <TEXT TYPE Action="0" Text=" "/>
  4. Building on what Cory said: Does the macro work if you move the file to something like "C:\Users\Public\Web\n1\generated\files-are-okay.txt"?
  5. You don't say how you get your html file. But, since you have upgraded to Macro Express Pro you should check out the new HTTP Get command. This command allows you to specify a URL and a variable. Macro Express Pro will load the html and save it to the specified variable.
  6. When you copy and paste a macro the variables are, in fact, not created. Macro Express (and Macro Express Pro) looks through the script for variables and prompts you to create them. There are at least 2 prompts per variable. Normally it works just fine to press the ENTER key a bunch of times until it stops asking for new variables. But, there are some rare cases where a command support different variable types. For example, it might allow either a string or an integer. In these cases Macro Express tries to make a good guess about which type of variable to define but once in a while it guesses wrong. For macros that you are writing this is normally not a problem. But for a macro from someone else you may need to figure out what type of macro is needed. This may not affect you at all but if the macro misbehaves you know what to look for. If there is a problem usually you will see a message that says the variable is the wrong type.
  7. I have found Window Activate and Wait for Window Title work well for the main window of an application but not always for dialogs that the application might pop up.
  8. It might work best to use Mouse Move: Relative to Current Window. I find it better to work with positions relative to the active window because I rarely have my applications at full screen. When they come up they are usually in slightly different positions. Another thing to consider is if the button moves when the active window is resized. If this is the case then your macro would be more reliable if you set the window to a specific size. Here is an actual example from one of my macros: Window Move and Size: Move "CMS: *Defect" to (635,320) and size to 990 x 750 Mouse Move: 90, 456 Relative to Current Window
  9. Here is an article about how have a macro send a text / SMS message to your phone: Send Text Messages to Mobile Phones
  10. For Windows the value for 'RETURN' is actually a CR followed by LF. You can define variables to represent CR and LF: Variable Set to ASCII Char 13 to %CR% Variable Set to ASCII Char 10 to %LF% Then you could use something like this: If Variable %x% Contains "Hello%CR%%LF%There" to search for Hello there There are a couple of ways to search for parts of the message. If Variable %x% Contains "Hello" AND If Variable %x% Contains "there" MessageBox: Result True Else MessageBox: Result False End If Another way would be to parse the message using the Variable Modify String command options. (This is more involved so I do not provide an example here.)
  11. There is nothing inherently risky about saving data in the registry as long as you know and remember which registry area (key) you use. Using the registry may be somewhat faster than reading from a file. However, depending on what your macro is doing, you may not notice the difference. There is a potential side effect of using values in the area of the registry (registry key) that Macro Express uses such as this: HKEY_CURRENT_USER\Software\Insight Software Solutions\Macro Express 6\My Values When you export the Macro Express settings (Tools, Export Program Configuration) and then import them either later (Tools, Import Program Configuration) Macro Express will display a warning about the registry keys and values that it does not recognize. It is pretty safe to use other areas of the registry such as HKEY_CURRENT_USER\Terry Work Area You could also use something like this: HKEY_CURRENT_USER\Software\Insight Software Solutions\Macro Express Data
  12. You're welcome. Also try Alt+Left to move to the list of commands and Alt+Right to move to the script.
  13. To enter a comment on a separate line: while in the Script Editor press Alt+Down Arrow to move to the Search box. Type "Comment" and then press the ENTER key. The Comment dialog comes up.
  14. A comment without text is a blank line. // ---------------------------------------------------------- // Initialization // ---------------------------------------------------------- Variable Set From Misc: "Name of Current Macro" into %MacroName% Variable Set String %T[1]% to "" Variable Set String %T[2]% to "You indicated that you are running Windows " Get OS Version String: %T[5]% // -------------------------------------------------------- // Display Introduction and Instructions // -------------------------------------------------------- Variable Set Integer %Left% to 0 // Unused
  15. If you intended to have your macro wait 15 seconds after the Bookmarks window closes you should not use Macro Stop. No macro commands, including the Delay command at the end, will run after the Macro Stop command. Instead use Break. That skips to the macro command after the End Repeat. However, in this case, neither Break nor Macro Stop is needed because setting T77 to Done will stop the repeat loop. Try something like this: // Run the macro until the window is closed. Variable Set String %T[77]% to "Not" Repeat Until %T[77]% Equals "Done" If Not Window "Bookmarks - Google Chrome" is running Variable Set String %T[77]% to "Done" End If Delay: 100 milliseconds End Repeat Delay: 15 Seconds You still need some delay inside the repeat loop for the reason stated above.
  16. The delay after End Repeat will never be used. It should look like this: Macro Stop End If Delay: 15 Seconds End Repeat Without the delay inside the repeat loop Macro Express will run these macro commands as quickly as possible without slowing or stopping. It will use 100% of one of your CPU cores. This puts your macro into what your computer considers an infinite loop. I wouldn't be surprised if more than Chrome freezes. And Terry is right, your delay command contains 15 milliseconds instead of 15 seconds.
  17. Another way to accomplish this is to not let the macro halt until the window has been closed. If a specific macro is running it cannot be activated again. This demonstrates using Notepad. Text Box Display: Note_pad is running Repeat Until %Done% Equals "Done" If Not Window "Notepad" is running Variable Set String %Done% to "Done" Macro Stop End If Delay: 1000 milliseconds End Repeat <TEXT BOX DISPLAY Title="Note_pad is running" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil Tahoma;}}\r\n{\\colortbl ;\\red0\\green0\\blue255;}\r\n\\viewkind4\\uc1\\pard\\qc\\cf1\\f0\\fs28 Notepad is running\\cf0\\fs20 \r\n\\par \\pard \r\n\\par }\r\n" Left="Center" Top="Top" Width="455" Height="76" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x02" Delay="0"/> <COMMENT/> <REPEAT UNTIL Variable="%Done%" Condition="\x00" Value="Done"/> <IF NOT WINDOW Option="\x01" Title="Notepad" Partial="TRUE" Wildcards="FALSE"/> <VARIABLE SET STRING Option="\x00" Destination="%Done%" Value="Done" NoEmbeddedVars="FALSE"/> <MACRO STOP/> <END IF/> <DELAY Flags="\x02" Time="1000"/> <END REPEAT/> In this example the text box display has a window title of "note_pad" because if that window title is "notepad" the macro never ends.
  18. That issue was fixed in a later version of Macro Express Pro 4. The latest version of Macro Express Pro 4 is v 4.9.0.1 available here. However, in the long run, I think you''ll be happy having upgraded to Macro Express Pro 6.
  19. Here are some suggestions that may help: 1. There is a command to extract the filename from a full path. Take a look at the "Variable Set From File path" macro command. 2. Add a "Wait for File to be Ready" macro command before the "If File Exists"" macro command. Macro Express may get to the If File Exist command before Windows has finished copying the file. 3. Since you already have the filenames and file paths consider using the "Copy File/Files" macro command to copy the files. It is generally easier to copy the files using Macro Express instead of manipulating Windows File Explorer to copy files. 4. If you were to use descriptive variable names it would make your macro easier to understand. For example maybe %SourceFile%, %DestFolder%, or %Filename% instead of %T3% and %T4% in addition to %nPos%. %Input%, and %Output%.
  20. Generally, in Windows, this appears as CRLF, not LFCR. Try this: Variable Modify String: Replace "-A%CR%%LF%" in %Temp% with ""
  21. Try using Ctrl+a, not Ctrl+A. When you use Ctrl+A Macro Express sends: <Ctrl Down><Shift Down>a<Shift Up><Ctrl Up>. Many programs will not respond to that.
  22. Seems to work for me. Note that the Macro Express Script Editor automatically highlights a macro command when it has been entered so the background color is blue. But, if you close the macro and reopen it the background color appears correctly.
  23. To copy the macro: highlight acantor's example in the second box (the one that starts with <VARIABLE) , type Ctrl+c to copy to the clipboard, open a new macro in Macro Express and type Ctrl+v to paste.
×
×
  • Create New...