Jump to content
Macro Express Forums

kevin

Admin
  • Posts

    1,950
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by kevin

  1. The 'Idle Time' means that keyboard and mouse events have not occurred for a while. In other words, the user hasn't done anything for a while. Macro Express does not monitor CPU utilization. A Time Out macro will activate even though a program, such as a virus scanner, is actively using many CPU cycles.
  2. According to Macro Express Explained (page 185), on Windows 95, 98 and Me the default maximum environment space available is 4,096 bytes. On Windows NT, 2000 and XP the maximum spece is 32,768 bytes for each user. These figures are the total space available. Any environment variables defined by your system use up a portion of this space. There is a way to increase the environment space on Windows 95, 98 and Me from the default 4K but I have forgotten the details and would have to do some research to retrain myself.
  3. I would be surprised to learn that Environment variables allowed any CRLFs. I thought environment variables would only hold letters, numbers and punctuation you can see, not tabs, CR, LF, etc.
  4. Often the form itself will be a Window Control. If this is the case you could capture the control that makes up the form instead of the button. Also, when you capture the control try turning off the 'Capture using Text' option. You may find another control on one or the other forms that identify it. Is the size of the dialog different between the two dialogs? If so, you could use the commands that get the size of the dialog to determine which form is displayed. Could the position of the dialog identify it? You can also get the position of the dialog.
  5. Umm, I'm not sure how to answer. This depends on how your macro is written. I may be the one misunderstanding the issue here. If so, I apologize. But, to understand this you may want to study how the Variable Evaluation Level macros work. The macro does NOT create new variables with names like %T%N1%%. The variables are T1 through T99. When you put a number in %N1% that is between 1 and 99 then you can use the technique. If N1 = 11 then %T%N1%% accesses T11. If N1 = 12 then %T%N1%% accesses T12, etc. Note, errors will occur if N1 is 100 or greater. Errors may occur if N1 is between 1 and 9 because <TVAR2:%N1%:01:%T99%\s> expects two digits. You may get around this by putting 1 through 9 in another string variable and prepending a '0' so it is 01 through 09. Again, if N1 = 10 then %T%N1%% refers to %T10%.
  6. Inside Macro Express, each macro command can be represented in one of two ways. In a binary format or in an ASCII format. The ASCII format allows you to use something like a Text Editor to edit macros. You can see this format by clicking on the Direct Editor icon within Macro Express. You cannot see the binary format directly. Instead you see the macro script representation of the commands. The ASCII form of the commands is the predecessor to the current macro script/binary form of the commands. You can use the ASCII form of the commands to do some advanced macro programming. For example, you can have a mainframe application create macros that run on Macro Express. Many companies have custom programs that are written by (or for) them and are proprietary. These programs can be written to create macros and have Macro Express run them. And, you can create 'dynamic' macros or, in other words, macros that change other macros. As an extension to these techniques, you can also put the ASCII form of the macro commands in a variable and use the Run Macro in Variable command to run it. The reason we use the Run Macro in Variable command in this case is because the Scripting Editor does not allow us to dynamically change the macro command on the fly. The ASCII representation of the macro command Variable Set String %T10% "%T99%" looks like this: <TVAR2:10:01:%T99%\s> This command will copy the content of the variable T99 to the variable T10. The :10: portion of the command represents T10. The command looks like this in the Scripting Editor: Variable Set String %T10% "%T99%" We can use :%N1%: in place of the :10: to put the content of T99 into different variables. The Macro Express Player understands this syntax and will run it properly. <TVAR2:%N1%:01:%T99%\s> But, the Macro Express Scripting Editor does not allow us to enter it this way. You could enter this command into the Direct Editor but if you view this macro command in the Scripting Editor it will be converted to this: Variable Set String %T256% Text Type: :%T99%> and it will no longer run properly. So, to get around the syntax checking within Macro Express, we place the macro command in a variable and then 'run' it. There is one more thing that should be explained. There is a character that we call the 'separator character'. On our computers it looks like an upper case L that has the vertical portion cut off. This character is difficult to type using a text editor such as notepad. The separator character is used by some macro commands to indicate the end of a string or the end of the macro command itself. When using the Run Macro in Variable command, the separator character can be represented by \s.
  7. How about this: Variable Set String %T99% from Clipboard // Copy from clipboard Variable Set String %T98% "<TVAR2:%N1%:01:%T99%\s>" // Put the direct editor command to Set Variable into T98 Run Macro in Variable %T98% // Run T98 Of course the comments in this example are not in the same position that Macro Express would place them. As Randall points out, this should work as long as the Variable Evaluation Level has been enabled. See the Variable Evaluation Level sample macro for information about how to enable this.
  8. Macro Express will not run two macros at the same time. But, other macros can run during the time when a scheduled macro is not running. In other words, for the example you describe, every 10 minutes there will be a brief moment when you will not be able to activate your volume up/down macro but it will run the rest of the time.
  9. How long are your 'longer' wav files? I tried your macro using several wav files and it works fine here. But, I do not have any wav files that are longer than a few words. When Macro Express plays a wav file it sends a message to Windows asking Windows to play it. The message contains flags to tell Windows to wait until the sound file has finished playing. If I remember correctly, there is a message that can be sent to interupt the playing of a sound file. If the wav file you are playing is long enough, it could be that another process in Windows is sending a message to stop playing the current sound file and play a new one. This is just a guess.
  10. Windows processes keys sequentially. When you hold the Control key down, press 3, and then release the keys, this is what is sent: What is sent for each keystroke actually looks more like: Computers can only do one thing at a time. It just does them very fast. So it will always detect one key at a time. Having said all that, have you tried this:
  11. Is there a message displayed when the macro stops? For example, do you see the the Windows XP message that says: Some messages that come from a low-level of Windows can stop macros. This message is on by default in Windows XP but can be turned off.
  12. There is not a macro activation based on the file size. However, you could create a scheduled macro to periodically check the file size. You will have to decide how often to check, every 10 seconds, every minute, once an hour, etc. Then, the top of your macro may look something like this: Wait for File Ready: "test.txt" Variable Set Integer %N1% from the size of file "test.txt" If Variable %N1% < 1234567 Macro Return End If // Do your macro stuff here
  13. Yes, the macro file is locked and prevents any process other than the one that locked it from accessing the file. Unless something goes wrong the file is locked for a very short amount of time. Then the next process can access it. The macro file can be updated by running a macro within it. For example, enabling or disabling a macro will update the macro file. No. The macro file can be updated at any time. Yes, unless you want to risk losing your macro file. Not necessarily. If they haven't run that macro yet or if they just launched Macro Express or if their cache got full or if the synchronization routine detected a change or any number of other senarios that I can't think of right now, then the new version of the macro file will run. We have made every effort to make sure that the new version of a macro will run. If you want to develop a new version of a macro then copy it, develop it, and debug it. Once you update the orginal macro, you can bet that Macro Express will try to use the new version of the macro. It may take a little while but you cannot count on it being very long. Better yet, develop your macros in a separate macro file. This may not be possible if several people are writing macros at the same time. But even in that case you could develop the macro in a separate macro file and then export the macro from the development file and import it into the production macro file. Since only one macro can run at a time I do not recommend that macros run for a long period of time. How you break things up depends on your environment. The check to see if the macro file needs to be synchronized occurs at macro activation. So while a single macro is running, it will not be updated. However, if it uses the Macro Run command to run other macros, they may be updated.
  14. In this situation, the critial setting is File Locking of Macro Files. This forces Macro Express to check to see if another process (another copy of Macro Express or a file copy) is making changes to the macro file when Macro Express wants to update the macro file. If more than one copy of Macro Express is updating the macro file, then the second one to attempt to update will wait until the first is finished. If two copies of Macro Express happen to update the macro file at the same time then your macro file is going to get trashed. We cannot predict what will happen when a macro in the trashed file runs. To be safe you need to enable the File Locking of Macro Files feature. Macro Express compares the macro file's size and date/time stamp with the size and date/time stamp of the file when it was loaded into memory. If the macro file is newer it loads it again. This process flushes the macro cache. Up until now we haven't discussed the macro cache. The macro cache is a critical piece of this discussion. The first time a macro is activated, it is loaded into the macro cache just before it runs. The next time the macro runs, if it is in the macro cache, it runs without accessing the macro file. If the cache is too small to hold all of the macros, as macros run, the most recently used macros are stored in the macro cache and less recently used macros are dumped. Macro Express allows you to set the size of the macro cache. See the Macro Caching setting under Options, Preferences, Caching. To use a minimum amount of memory you can disable macro caching altogether. If macro caching is disabled then every time a macro is activated, the macro will be loaded from the macro file. The File Locking of Macro Files feature described above protects the macro file. The File Locking logic would detect that you are currently writing to the macro file and hold the sync up for a moment. By the way, all this locking and syncing happens at computer speeds. It is hardly noticable. In summary: If you are sharing a macro file you must enable File Locking of Macro Files on each computer running Macro Express or your macro file is at risk.
  15. I agree. It is good to start a new topic to discuss this. To answer some of your questions I am reposting the following that was originally posted in the 'Line Numbers' topic: The feature to share a macro file works fine and is very convenient in situations like yours. But it will not be reliable unless you enable the Network option File Locking of Macro Files. As a convenience we also suggest that you enable the Automatic Synchronization Update. But, if your network or your server(s) are not reliable and go down from time to time, and if most of the applications used by your users are on their local computers, then you may want to consider having the macro file on each individual computer. This allows the users to continue to work when the network or a server goes down. However, if your network and server(s) are very reliable or if most of the applications used by your users require the network and server(s), then it doesn't matter if the macro file is in a central location. In this senario, if the network goes down, they can't work anyway so it doesn't matter if Macro Express is not working. Some of the customers who are updating their macro files using the techniques described previously do not have permanent connection to their server. Some of them are updating their macro file via an FTP file transfer.
  16. The feature to share a macro file works fine and is very convenient in situations like yours. But it will not be reliable unless you enable the Network option File Locking of Macro Files. As a convenience we also suggest that you enable the Automatic Synchronization Update. But, if your network or your server(s) are not reliable and go down from time to time, and if most of the applications used by your users are on their local computers, then you may want to consider having the macro file on each individual computer. This allows the users to continue to work when the network or a server goes down. However, if your network and server(s) are very reliable or if most of the applications used by your users require the network and server(s), then it doesn't matter if the macro file is in a central location. In this senario, if the network goes down, they can't work anyway so it doesn't matter if Macro Express is not working. Some of the customers who are updating their macro files using the techniques described previously do not have permanent connection to their server. Some of them are updating their macro file via an FTP file transfer.
  17. It is Windows (or Terminal Services) that makes it so the macros do not run. This occurs with Citrix and Windows Terminal Services as well. The only work-around we have found is to leave the session connected. One customer simply set up an old computer and left it connected.
  18. We have had so many request for line numbers it is likely that they will be added in a future version of Macro Express. There are a couple of things you can do to make distributing an updated macro file easier. These tips apply to updating the entire file, not just a macro or two inside it. If you need to update individual macros then the best way is to have the user import the macros. First, you may want to try Network Synchronization. Macro Express has the ability to periodically check to see if the macro file has been updated. This is designed to allow a single macro file located on a server somewhere to be shared by several computers running Macro Express. This option is turned off by default because the added complexity of checking for shared network operations can slow down the macros. However, in most cases the speed difference is not noticable. We had to design special macros to measure the difference. You can turn on the Network Synchronization features in Options, Preferences, Network. While Network Synchronization is designed to support a single macro file, you should be able to turn this on for computers that do not share a macro file to allow you to safely updated the macro file while Macro Express is running. A second approach to updating the macro file is to use two macro files like this: - Copy the updated macro file to a temporary file on the computer. - Have a macro that detects this temporary file. - Open an updater macro file that runs a macro to do the next 3 steps: - Rename main macro file with a backup name. - Rename the temporary file to the main macro name. - Load the newly updated main macro file.
  19. I did not try the macro but I tried this manually: I typed "DIR /-C" at a command prompt on my Windows XP Pro, Windows XP Home and Windows 2000 Server systems. The commas were removed in all three cases. But, "DIR /-C" at an MS-DOS prompt on a Windows 98 virtual session did not remove the commas. Randall: I forget, what version of Windows are you using? Also, are you using a non-US English version? What happens when you manually type "DIR /-C" at a command or MS-DOS prompt? Cory: This is a great tip that I was not aware of. I'm glad to learn about it.
  20. This is on our list of possible future enhancements. You may, if you wish, add your request to the other similar requests by visiting http://www.macros.com/requestfeature.htm.
  21. There are two commands that will set the value of a Control variable. Use the Get Control command to set the value of the Control varible when you are writing a macro. Use the Capture Control to set the value of a Control variable when the macro is running.
  22. These are good points. Depending on the specific application I may even go one step further. It might be wise to write eveything to a temporary file and only use it if the macro completed successfully. Your point about incomplete records is valid but it could also be a problem if each record is complete but one or more records are missing.
  23. Cory's suggestions are good and I agree. I have a couple of further comments. If you wish you can surround each field with double quotes. This eliminates the need to test for commas. What I do is if the field cannot possibly have a comma, then I leave the double quotes off. If the field could have a comma, I put it on for all fields. The Variable Modify String: Append %T1% to Text File command has an option to append the CR/LF for you.
  24. Alistair: Try either the Text File Begin Process or the ASCII File Begin Process commands. Use the Text File Begin Process command if you want the complete content of each line from the text file placed in a single variable. Use the ASCII File Begin Process command if each line in the text file contains multiple 'fields' that you want placed in separate variables. There are examples in the help topic for each of these commands that demonstrate their use. Examples in the forum that are not in "Direct Scripting Text" (or the format used by the Direct Editor) cannot be copied and pasted into your macro file. When I include a sample macro, I generally use the Scripting Text because it is clearer for a person to read and understand. If I feel further explanation is needed I describe how the options within certain commands are set. Others in this forum include both the Scripting Editor and Direct Editor formats. You can copy the Direct Editor format and paste it into your macro file but you need to make sure the 'separator' characters are not removed.
  25. Eric, When I last tried to read from a Status Bar it worked for me. Get Control %C1% (Insight Software Solutions - All Products - Microsoft Internet Explorer: msctls_statusbar32) Variable Get Control Text: %C1% to %T1% Text Box Display: T1 Because the window control may change for each web page, you may need to use the Capture Control command instead of the Get Control. The Get Control command requires that you know the position of the control. You can get the position and size of a Window using the Variable Set Integer %N1% from Top of Window, Variable Set Integer %N2% from Left of Window, Variable Set Integer %N3% from Width of Window, and Variable Set Integer %N4% from Top of Window commands. This was discussed in this post: http://pgmacros.com/community/index.php?sh...3&hl=status+bar
×
×
  • Create New...