Jump to content
Macro Express Forums

kevin

Admin
  • Posts

    1,945
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by kevin

  1. I would try the Load Macro Text File command. Have your vbscript write to a text file. Create a macro that does not change and contains the Load Macro Text File command. Set it to run the macro in the text file created by your vbscript. The macro can be activated either via a hotkey or by calling meproc.exe with a /aTextMacro parameter. This would be much faster and more reliable than using the Direct Editor user interface.
  2. It may be that your macro has a syntax error that Macro Express misses but Macro Express Pro catches. The syntax checking has been improved in Macro Express Pro. I suggest that you copy the macro and then start deleting sections of the macro until the syntax error goes away. As you delete lines make a mental note of what is being removed. If you are not able to resolve the issue that way then send your macro to the Insight Software Solutions support people. If there is an error in the program, we would be very interested in correcting it.
  3. Use the macro command Read Registry Value "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Version" into %IE_Version% to read the version from the registry. Microsoft documentation here: Information about Internet Explorer versions. This sample macro displays the version number of Internet Explorer: Read Registry Value "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Version" into %IE_VersionStr% Split String "%IE_VersionStr%" on "." into %IE_Version%, starting at 1 Text Box Display: IE Version To run this sample macro copy the following and paste it into a macro: <READ REGISTRY VALUE Key="HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Internet Explorer\\Version" Destination="%IE_VersionStr%"/> <SPLIT STRING Source="%IE_VersionStr%" SplitChar="." Dest="%IE_Version%" Index="1"/> <TEXT BOX DISPLAY Title="IE Version" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 Full version string: \\f1 %IE_Version\\f0 Str\\f1 %\r\n\\par \r\n\\par \\f0 Major: %IE_Version[1]%\r\n\\par Minor: %IE_Version[2]%\r\n\\par Build: %IE_Version[3]%\r\n\\par Sub-build: %IE_Version[4]%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="313" Height="181" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>
  4. It sounds like TradeStation is blocking access to the Windows hooks. The Hooks allow other programs, like Macro Express, to send keystrokes and mouse events. Some companies block the hooks to prevent malware activities. But they do not discriminate and also block useful and valid programs like Macro Express Pro.
  5. Does TradeStation run as an administrator? Some programs, for compatibility reasons, run as an administrator on Windows 7. Macro Express Pro cannot send keystrokes or mouse clicks to a program running as administrator unless it too is running as an administrator.
  6. Some ideas: Would it work to delete the existing files? Try the Delete File or Files command. How are you emptying the file? From your description it sounds like you may be writing a CR/LF when writing the empty string to the file. Look for an 'Add Trailing CR/LF' option and uncheck it. Sometimes I need to start with a file that is almost empty. For example, I may want a line containing a header but no data lines. In these cases I create an 'HeaderOnly' file and copy it over the files that need to be emptied.
  7. Microsoft offers a Windows 7 add-on that emulates Windows XP. This is a bit different than Virtual PC. The virtual software can be installed on Windows XP and later. It does not have to be a server. (VMWare also has a version that will run Windows on your Mac.) Yes, as long as the virtual machine is running, the macros continue to run. They stop if you log off of Windows but they continue to run if you disconnect.
  8. Just to be clear, when the RDC session is disconnected Macro Express continues to run but Windows, on the remote computer, decides that since there no keyboard and monitor connected it can ignore all keyboard and mouse input. The result is that the macro accomplishes nothing. (If your macro contains no keyboard or mouse activity and does not rely on things like window titles, it may continue to work.) Virtual machines work great. Another choice besides VMWare Player and Virtual PC would be is VirtualBox. I use VMWare extensively, have tried Virtual PC but I have not personally tried VirtualBox. All have free versions.
  9. The FTP commands built into Macro Express are FTP, not SFTP. You could use Macro Express to automate an external SFTP program. The message "Cannot establish FTP connection. Only one connection is allowed at a time." is coming from the host you are trying to connect to. Macro Express simply reports the message it receives from the remote host. Check the security settings on your host. Your host computer may be set to allow only one connection. When I had a similar message I discovered that a mapped drive counted as one connection and prevented a second connection via FTP. To resolve it the security settings on the host computer had to be changed to allow more than one connection.
  10. This works if you are using Integer variables. Something like this might work if you want to use Decimal variables: Variable Modify Decimal: %D2% = %D1% / 5 Variable Modify Decimal: Copy fraction part of %D2% to %D3% Variable Modify Decimal: %D4% = %D3% * 5 Round Decimal Variable %D4% to 0 decimal places If Variable %D4% = 0 // Divisible by 5 Else // Not divisible by 5 End If
  11. A child window may have a title even if it is not displayed. If you can determine the title of the child you can use the Window Resize command to resize it. There are two ways to determine the child window's title. The first, and easiest, is to open a Window Resize command, choose 'Specific Window' and click the 'Select Window' button. I would do this when the child window is not displayed and again when it is displayed and note the differences in the list of windows. In some rare cases a child window does not appear in that list but can be discovered using the Repeat with Window command. Try something like this: Activate or Launch: "Notepad" OR "notepad.exe" Repeat with Windows: Place title in %T1% If Not Window Title "Notepad" on top Activate Window: "Notepad" End If Text Type: %T1%<ENTER> Delay 0.05 Seconds Repeat End Macro Express does not have a way to resize a child window without a window title.
  12. Not directly. You may, however, incorporate an hta form to accomplish this. See the forum topic that discusses this here.
  13. What is defined as a Windows Control is dependent on the application itself. In addition to an entire window or dialog an individual edit box or button may be a control. Applications do not generally allow certain types of controls to be resized. You can automatically resize a window using the Window Resize command. I would recommend that you try to find a way to get the title of the dialog or window that is pointed to by your control variable.
  14. If you know or can determine the position of the control(s) you could use the Capture Control command.
  15. To have the macro prompt the user for a folder use the Variable Set String %Folder%: Prompt for a foldername command. To split a file path into separate parts (drive, path, file name, extension) use the Variable Set From File path command. You can then combine the separate parts of the file name using the individual variables.
  16. The 'fault' is most likely due to timing. When Macro Express interacts with the Windows clipboard and with other applications they, not Macro Express, determine how fast things happen. Macro Express could be changed to always wait long enough for all clipboard functions to be successful but then every clipboard command would take a full second. Check the 'Wait [ ] milliseconds between clipboard commands' setting found in Options, Preferences, Playback on the Delays tab. This allows you to adjust the amount of time that Macro Express waits between clipboard commands for your specific computer. In our testing we determined that a good compromise value for this was 250 milliseconds. This allowed macros to work 98% or more of the time. Try adjusting the value to a larger value. Another possible issue could be that the application is not able to accept the information as quickly as Macro Express is sending it. If, for example, the pasting of data causes the application to scroll, you will need an additional delay. You could try adding a delay after the Clipboard Paste command.
  17. <dataset fielda="xxxxxxxxxxxx" fieldb="xxxxxx" fieldc="xxxxxx" <value>example1</value> </dataset> Read the content of the file into a variable. Set one integer variable to the location of '<dataset'. Set another integer variable to the location of '</dataset>'. Then copy the data between. This untested sample should get you started: // Read content of file into a variable Variable Set String set %Content% to the contents of c:\TheFile.xml Variable Set Integer %Start% to the position of "<dataset" in %Content% // Find position of <dataset Variable Modify Integer: %Start% = %Start% + 8 // Adjust to skip over <dataset Variable Set Integer %End% to the position of "</dataset>" in %Content% // find position of </dataset> // Copy the data between the tags Variable Modify String: Copy a substring in %Content%, starting at %Start% and %End% characters long to %OneTag% After processing one tag you could delete it from the %Content% variable to get ready to process the next variable.
  18. Macro Express is constantly watching for windows and controls to come and go. If you have scheduled macros, it is checking every 10 seconds (by default but if I recall from another thread, you have set it to 1 second) to see if it is time to run another macro. It is watching for messages indicating that a file or folder has changed. Macro Express is never completely idle.
  19. There is not a single command to close all programs but you might have some options. You could try the Shutdown or Logoff commands and rely on Windows to close the programs. You might also use a Repeat with Windows and/or Repeat with Processes loop to close programs. If you use a Repeat command you would need to program in exceptions to only close programs or Windows that not part of Windows itself. Or you might create a macro that uses the If Window and/or If Program Name Running commands to determine if individual programs are running and close them. Since running programs may contain unsaved data, I expect the last option would be safest.
  20. I recall reading that the Windows Registry is designed to store small amounts of information. You should store larger amounts of data in a file. I found this link after a very brief internet search: Windows registry information for advanced users.
  21. You could use the debugger to step through your macro from within the Script Editor. Click Debug, Show Variable values to display the variables as you step through the macro. Or you can insert a Text Box Display command with "C:\McL\Admin\Scans\%T[1]%.pdf" in it to display the path. T1 and T[1] are not the same variable. You can use either but do not expect them to contain the same thing. T1 is a variable containing a string. %T[1]% is part of an array variable. You access individual elements of the array with an index like %T[2]% or %T[%Idx%]%. Note that %Idx% is an integer variable in this case. Instead of using T1 as a variable name you should consider using a name that reflects the purpose of that variable. You might use %NewFilepath%, for example.
  22. Try the Variable Set String %T1% from Window Title command.
  23. I confirmed this. It is interesting behavior. On Windows 7 the position of a maximized window is reported as -8, -8. This is because the borders around windows in Windows 7 are wider than Windows XP. I too am surprised that I have never heard of or noticed this behavior but it makes some sense. Macro Express gets the size and position of windows from Windows. It reports exactly what Windows reports.
  24. Thanks to Joe Weinpert and Professional Grade Macros the PGM Functions Library is now free.
  25. Macro Express Pro v 4.2.2.1 Macro Express Pro v 4.2.2.1 is now available. This version includes these changes: Fixed a problem where in some cases the name of a variable was copied instead of the content of the variable, Added the ability to edit a macro even if it's locked by another user. The errors in the 'Catch Error' dialog are now sorted alphabetically. When the macro error dialog is displayed, the user can now press Ctrl+C to copy the contents of the window to the clipboard. Fixed a bug in the 'Variable Modify String: Copy part of string' command where the source variable was not processed. The 'Variable Set From File path' command now returns the correct filename when the file extension is included twice in the filepath. The 'Encrypted Text' command now supports the 'Keystroke Speed' settings properly. For a complete list of changes, see the Macro Express Pro v 4.2.2.1 Release Notes. Download Macro Express Pro from the Macro Express download page. For more information, including tips and sample macros, we invite you to read the January 14, 2011 issue of the Macro Express News.
×
×
  • Create New...