Jump to content
Macro Express Forums

joe

Members
  • Posts

    1,002
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by joe

  1. Hello Athena! The default HotKey for suspending and resuming Macro Express is Ctrl+Alt+Shft+U .
  2. Hello Linda! Can you post an example of your solutiion? I'm trying to envision it, but now my brain hurts
  3. Hello Egan! Here is one solution ... although eloquent is in the eye of the beholder . This macro uses the O/S's DIR command to get the size of a disk drive and also the size of all files in a folder. Just change the variables to suit your situation. I have attached a playable mxe file. // T1=Drive, T2=Output file, T3=Output folder, T4=Input folder Variable Set String %T1% "c:\" Variable Set String %T2% "FreeSpace.txt" Variable Set String %T3% "c:\Temp" Variable Set String %T4% "c:\Pgm3" // If output file exists then ersae it If File Exists "%T2%" Delete File or Files: "%T2%" End If // Get the drive free space Program Launch: "cmd" Wait for File Exist: "%T2%" Wait for File Ready: "%T2%" // Scan for the "bytes free" line Text File Begin Process: "%T2%" If Variable %T5% contains "bytes free" Break End If Text File End Process // Extract the drive size to D1 Replace "bytes free" with "" in %T5% Variable Modify String: Trim %T5% Variable Set Integer %N1% from Position of Text in Variable %T5% Variable Modify String: Delete Part of %T5% Variable Modify String: Trim %T5% Variable Modify String: Convert %T5% to decimal %D1% // Now get the sizes of the files within the input folder Delete File or Files: "%T2%" Program Launch: "cmd" Wait for File Exist: "%T2%" Wait for File Ready: "%T2%" // Scan for the "bytes free" line. Save the line number Variable Set Integer %N1% to 0 Text File Begin Process: "%T2%" Variable Modify Integer: Inc (%N1%) If Variable %T5% contains "bytes free" Break End If Text File End Process // Extract the folder size to D2 Variable Modify Integer: Dec (%N1%) Text File Begin Process: "%T2%" Text File End Process Replace "bytes" with "" in %T5% Variable Modify String: Trim %T5% Variable Set Integer %N1% from Position of Text in Variable %T5% Variable Modify String: Delete Part of %T5% Variable Modify String: Trim %T5% Variable Modify String: Convert %T5% to decimal %D2% Macro Return DriveAndFolderSizes.zip
  4. Hello Nicolas! There was a project that we had worked on a while ago. It required accessing and gathering data from approximately 20,000 web pages per month. It was run 24/7, which meant a new page every 30 seconds. There are four things that we did to make the waiting for web pages more reliable: We made sure that IE would check for a new page each time (Tools | Internet Settings | General | Settings) We would place the Wait for Web Page command immediately after the Web Site command. No pauses or delays of any kind between them. This prevented the Wait for Web Page command from missing the "okay" signal from the O/S (now the two commands can be command into one). We waited for the IE "progress bar" to finish by trapping for a change in pixel colors within a Repeat Loop. We placed a Delay of 1 second following the loop. We had actually set up two computers. One simply gathered the data using the above steps and saving it to a file, while the other processed the data. By taking these steps, we were able to get the macro to run reliably for a long period of time. I think the longest it ran was 10 days before memory leaks from Microsoft O/S froze the machine.
  5. Yes. Most, but not all, of the sections within a Macro Express command are a fixed length. This can look real strange for coordinate positioning fields, which will accept literal, variable, and text values: :000000: :000256: :00%N2%: :0%N88%: :Center: :Bottom: :000Top: are all six characters in length.
  6. Hello Les! Variable Set Integer %N2% to 34 Variable Set String %T1% "Abc...xyz %D--%" Replace "--" with "%N2%" in %T1% <IVAR2:02:01:34><TVAR2:01:01:Abc...xyz %D--%><TMVAR2:21:01:00:000:000:--%N2%>
  7. You are perfectly welcome! The sample was just a template that was meant to be changed it at will. Glad it worked out for you.
  8. Hello K_H! It sounds like you are wanting to create, or open, a .doc document and have it based on a particular .dot template. Clicking on the Word template (as you say) does this. But of course Word is already launched with the normal.dot template. Here is a link to an earlier topic that covered how to use Macro Express to launch Word along with a specified .dot template. Hope this helps!
  9. Hello Linda! The code doesn't look correct. It looks like, for whatever reason, there is an extra separator character (""). The command should look like this as viewed from the Direct Editor: <TEXTTYPE:<CTRLD>2<CTRLU>> Which would answer why it works okay after reentering the command. You could have also used the simpler form of: <TEXTTYPE:<CONTROL>2>
  10. Yes ... and more. Here is a link to the Table of Contents.
  11. Welcome Lon! Use the Change Directory/Folder command first. This will position you into your target folder. Change Directory/Folder: "c:\temp" Create Folder: "TestFolder" Use the Prompt for Value command within the Variable Set String dialog to store a folder name to a variable. The variable can then be used in place of a literal value. For example: Change Directory/Folder: "c:\temp" Variable Set String %T1% from Prompt Create Folder: "%T1%"
  12. Welcome kotto! The command you want is within the Variable Set From Misc dialog. Set Variable %T1% to "Name of Current Macro"
  13. Hello jmb4370! There is also a sample.mex library file in the Macro Express home folder that contains other macros that you can look at. A mex file is a library of individual files. An mxe file is just an individual macro that can be imported to, or exported from, a library. Macros are nothing more than text files. As to your other problem, post the macro that you are having trouble with to the forum so others can look at it and maybe see the problem.
  14. Hello sbmichele! When you move the mouse and click, could it be clicking on something to force a refresh?
  15. Hello cbv! You can run a batch file from Macro Express using the Program Launch command. In order to trap what your batch file outputs, have it create a file, in a known location, that is named something like 0.txt, or 1.txt, and so forth. Attached is a sample DOS batch file that simply creates a file named testout.txt when it is run. I've also attached a sample playable macro. Delay 250 Milliseconds Variable Set String %T1% "c:\pgm3\output\testout.bat" Variable Set String %T2% "c:\pgm3\output\testout.txt" If File Exists "%T2%" Delete File or Files: "%T2%" Delay 500 Milliseconds End If Program Launch: "%T1%" CreateFileUsingEcho.zip
  16. Hello Paul! What do you mean by auto sign-in feature?
  17. Hello! Thanks Paul! The PGM Functions Library (link) is sold through Insight Software Solutions. Here is a (link) to the Macro Express Explained book, too.
  18. Hello ffortino! There are no arrays in Macro Express, but a linear sequence of variable numbers can be stepped through like an array. The following code stuffs string variables T1 through T99 with values from the Registry. Is this what you are thinking about? We do this in several areas of our PGM Functions Library. Repeat Start (Repeat 99 times) Read Registry String: "T%N1%" Repeat End And there are other sophisticated ways of handling variables such as using dynamic macros. VarLoop.zip
  19. Hello Thoughts! It is true that only a single macro can run at any given time, but maybe your macro tasks do not have to be continually running, leaving an opening for other macros to run. I was thinking that you might be able to create this first macro to run when no other keyboard or mouse activity is occurring. You would then be able to run other macros.
  20. Hello Richard! Although I've never used a dialer program, I can't imagine that it would be anymore difficult than any other application that can be accessed with a keyboard and mouse. Are you having a particular problem with one?
  21. Hello Paul! The Windows Registry is designed to store data; strings, integers, doubles, and other types of data. The Windows Notepad is a quick, simple, but handy text editor, which also uses the Registry to store its settings ... like almost every other piece of software on your computer.
  22. Hello Kevin! Good question. Thanks for asking. Each user can control their own time setting by changing the Time Zone choice in the My Controls | Board Settings dialog.
  23. Hello conniek! Well, let's say that variable %N1% contains 500,000 then you would use the Variable Modify Integer command like so: Variable Modify Integer: %N2% = %N1% / 5000 Is this what you are asking? Also, I am curious; is this Metroscan software using Visual Foxpro databases? I ask because you designated .dbf as the database extension.
  24. Greg - I am not sure how it works, and I checked with Floyd, too. He gave me one of those long answers, which ended with "I'm not sure". What we do know, however, is that it is not working for you. Have you tried any of the Ping commands instead?
  25. Hello not_colin! When you say activated by a HotKey, I assume that you really mean activated by a ShortKey. Have you tried placing a delay of, say, 50ms as the first line in the macro? How are the ShortKey options set (Options | Preferences | ShortKeys)?
×
×
  • Create New...