Jump to content
Macro Express Forums

kevin

Admin
  • Posts

    1,950
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by kevin

  1. The sample shows how to do it but it will not run 'out of the box' because Windows Controls often vary between different versions of Windows (2003,XP,2000,NT,98,Me,95, NT) or depending on which view is being used in Calculator. If you examine the sample, it will show you how to do it. However, you will need to recapture the controls using your own computer.
  2. You might try adding a Log Errors command at the top of the macro. With some macro commands, this causes the errors to be written to a file instead of popping up an error dialog. You could then have your macro examine the error log file to see if an error occurred. The macro may stop, however. If this is the case you may need to have a second macro examine the error log file.
  3. The Date/Time command gets the date and has options to adjust the date a specified number of days, months, hours and minutes into the future or the past. You can put a variable containing the number of days (or months, hours and minutes) into the Date/Time command. Here is a macro fragment that demonstrates getting the date: Variable Set Integer %N1% to 30 Date/Time: Save "dddd, MMMM dd, yyyy" into %T1% <IVAR2:01:01:30><DT:dddd, MMMM dd, yyyyT:01:3:{P0%N1%}{F00000}{P00000}{P00000}> To complete your macro, add a Multiple Choice Menu to select how many days, set N1 appropriately, and use the Date/Time command to get the date. Then, once you have the date, you will need a few macro commands to put the date into Notepad.
  4. Floyd, What a great idea! Dave, There is a sample macro that demonstrates how to create a macro that uses the Windows Calculator program from within a macro. It doesn't use the Tan button but it is a good starting point. The macro file 'Samples.mex' is installed in the same folder as the Macro Express program. By default, c:\Program Files\Macro Express3. Open the Samples.mex macro file and look for the macro 'Calc ulator and Note pad'.
  5. Ahhh! You hit the nail on the head. Yes, this is the disadvantage in the way it is implemented right now. It is easy to get a value out but it is not easy to put a value in. The sample macros describe how to make this work. We have plans to improve this for a future version of Macro Express.
  6. Interesting. The % characters are stripped off during the search process. We'll have to look into that to see what, if anything, we can do about that. True. You only need to enable the Variable Evaluation Level feature once. Well, that is, once per computer or if you enable it for a specific user and you do not have 'All users use the same settings' then you would have to do it for each user. When you first set the option in the registry, you have to tell Macro Express to read it somehow. This can be done using the Reload Macro Preferences command or by terminating and restarting Macro Express. You could have your macro look in the registry to see if the Variable Evaluation Level is set and if it isn't then set it and reload the preferences.
  7. A description of the Variable Evaluation Level is also available on the shared macros page here: http://www.macros.com/usermacs/umvariableevaluationlevel.htm
  8. The Run Macro in Variable command allows you to create a dynamic macro. That is, a macro that can modify itself depending on other conditions. The example I used to use, until v 3.5d, was to accomplish what you asked in another post ... to have a variable reference other variables. In v 3.5d you can enable the Variable Evaluation Level and then use %T%N1%% but in prior versions that sort of thing required running the macro in a variable. For example, the command to copy variable T10 to T1 looks like this (in the Direct Editor): <TMVAR2:09:01:10:000:000:> If you wanted to copy T11 to T1 it would look like this: <TMVAR2:09:01:11:000:000:> Notice the :01:10: vs :01:11:. So, you could have your macro determine which variable to copy to and from, put <TMVAR2:09:01:10:000:000:> into variable T2 while altering the :01:10: part to reflect the appropriate variables, and then use the Run Macro in Variable to actually run it. The macro would adjust itself. Yes, it is true, that in a lot of cases you could just do a bunch of If statements to accomplish this. However, I have run across several examples where that is not possible (I wish I could remember the specific cases other than having one variable reference another). Using this technique can result in much smaller macros. We have had many requests to have a variable reference another variable. This has always been possible using the Run Macro in Variable command. But, for this specific case, it is no longer necessary if you enable the Variable Evaluation Level feature.
  9. This will move all the files from one folder to another: Repeat with Folder Move File or Files: "%T1%" Repeat End If you want to limit the number you move at one time, you might try this: // Set N2 to the number of files you want to move at a time ... in this case 20 Variable Set Integer %N2% to 20 Variable Set Integer %N1% to 0 Repeat with Folder Move File or Files: "%T1%" Variable Modify Integer: %N1% = %N1% + 1 If Variable %N1% >= variable %N2% Repeat Exit End If Repeat End You can simply repeat the macro to move another group of files.
  10. You could accumulate the names in a variable and separate them with a character that will never appear as part of the names. Perhaps something like this: Cory|Joe|Paul|Kevin Then you would have to write a routine to parse the names out of the variable.
  11. Randall said: The 'ME filePicker' command would be the Variable Set String %T1% from File Name command described above.
  12. If you did a Repeat with Windows and typed out the name of the windows that were found, you would find that there many more windows than you see on the screen. I just ran a macro that lists the Windows that are currently running and it found 85 of them. Activate or Launch: "notepad" OR "notepad.exe" Repeat with Windows: Place title in %T1% Text Type: %T1%<ENTER> Repeat End So, your macro runs. It finds and closes the 5 or 10 or 20 Windows Explorer windows that you have open. But the Repeat with Windows loop continues until it has examined all of the windows on your system. That is likely why you see the 30 second delay. Perhaps something like this would work: Activate or Launch: "notepad" OR "notepad.exe" Repeat with Windows: Place title in %T1% If Variable %T1% contains "C:\" Sound Wave File: 5F1.wav Window Close: "%T1%" End If If Not Window Title "C:\" running Repeat Exit End If Repeat End
  13. I don't think anyone has ever tried to terminate Macro Express using the Terminate Macro Express command from within a playable macro. I created a test macro and confirmed that there is a problem. If the playable macro containing the Terminate Macro Express command runs when Macro Express is already running, then it runs and shuts down Macro Express. If the playable macro containing the Terminate Macro Express command runs when Macro Express is not already running, then it runs and tries to shut down Macro Express but Macro Express is not correctly shutdown and remains 'in limbo'. This issue has been entered into our bug tracking system. We will work on a fix for a future release of Macro Express.
  14. I keep trying to find a better solution. The best solution would be to have the Explorer windows close each time you select a file. I cannot think of a way to do this with Explorer but have you considered using the Variable Set String %T1% from File Name? This command launches an Explorer window and allows you to select a file. Once selected you, can use the Program Launch command to launch the application that goes with it. You can even set a folder for the Variable Set String %T1% from File Name command to start in. Try this: Variable Set String %T1% "c:\MyFiles" Variable Set String %T1% from File Name Program Launch: "%T1%" or this: Set Variable %T1% to "Path to My Documents" Variable Set String %T1% from File Name Program Launch: "%T1%"
  15. The Repeat with Folder command loops once through the entire list of windows (hidden and non-hidden) currently running on your system. It only loops once through the list of windows. To confirm that the Repeat loop finishes, I would add a Sound Wave File or a Sound Beep command after the Repeat End. You can delete or disable this command later. Is it possible that your macro is being activated again?
  16. My testing with 'Scheduled Tasks' turned up some very interesting results. Even though a playable macro will run if I put c:\chkhosts.mxe in the Run dialog, the macro will not run when c:\chkhosts.mxe is entered into the Windows Scheduler. But, you can do what you need if you use MeProc.exe. Try this: "C:\Program Files\Macro Express3\MeProc.exe" /MXEc:\chkhosts.mxe in the 'Run:' field in the Windows Scheduler dialog. Replace 'c:\chkhosts.mxe' with the pathname of your playable macro. Is there a reason why you are not using Scheduled macros from within Macro Express itself?
  17. After some experimentation I have discovered that this is difficult to close a Windows Explorer window unless you already know the name of the folder that Explorer is pointing to. However, if the option 'Display the full path in the title bar' within My Computer/Windows Explorer is enabled, you may be able to use the Repeat with Windows command. Something like this: Repeat with Windows: Place title in %T1% If Variable %T1% contains "C:\" Window Close: "%T1%" End If Repeat End Have you considered using the Activate or Launch command to launch the applications instead of navigating through Windows Explorer? This will launch Notepad:Activate or Launch: "notepad" OR "notepad.exe" And this launches Microsoft Word: Activate or Launch: "Microsoft Word" OR "Microsoft Word" To try this technique, copy the following and paste it into the Macro Express Scripting Editor. You will need to modify this if your Shortcut used to launch Word does not exist in the same location. <LAUNCHYES3:0:0112Microsoft Word<LAUNCH:C:\Documents and Settings\All Users\Start Menu\Programs\Microsoft Word>
  18. Add a TextType command that types out the content of %T1%. You will probably have to use keystrokes or mouse movements to put the cursor in the correct location before you do the TextType.
  19. I suggest you try setting the activation to 'Schedule' and select an interval of 5 minutes.
  20. Highlight the Quoted macro in Randall's post (the one starts with '<' -- the second one) and copy it to the clipboard (Ctrl+c). Then open Macro Express, create a new macro (I would choose 'None' for activation) and paste from the clipboard (Ctrl+v). After examining the sample, you can either copy and paste it into your macro or adjust the macro commands inside your macro.
  21. It does appear that the keyboard is shifted. This does not look like a Caps Lock issue. If it were, the numbers would not be altered. It looks more like a Shift Lock (if there is such a thing). Could there be a Shift Lock setting in the application you are using? I recommend that you check for a Shift Down that is missing a Shift Up. You didn't describe your computer system or what you are using to activate this macro. We have had a report of a similar problem from a company using Macro Express in a Citrix/Windows Terminal Services environment. If they assigned their macro a hotkey of Ctrl+b then the control key was down inside their macro. What was happening is that the macro started sending keystrokes before Citrix/WTS had received the Ctrl key up message that is sent when the user released the Ctrl and B keys. If I recall correctly they may have also had a similar problem with Shift+b. If this is the cause, Here are some possible solutions: You may have success adding a small delay at the top of the macro. You may be able to add a Shift Up command at the top of the macro. The syntax checker may complain about a mismatched Shift command so you may need to do a Shift Down followed by a Shift Up. If the problem is caused by a shifted hotkey, try reassigning the hotkey to something without a shift. You may need to avoid control as well. Look for a setting in the application that deals with the shift key.
  22. The Repeat with Folder command uses Windows API calls to get the list of folders. Windows maintains a cache containing the list of folders (and files). The Windows APIs return the content of the cache. If Windows hasn't updated the list of folders, then Macro Express will not receive the updated list. From time to time I have seen cases where a folder (or filename) does not exist in Windows Explorer. Because of this I have developed the habit of pressing the F5 key to refresh Explorer. We should also note that folders added when the Repeat with Folder command has already started will likely not be listed by the macro. One possible work-around would be to force Windows to refresh the list of files and folders. This, however, takes time. If we could tell when the cache is not up to date then we could only force the update then. However, there isn't a way to determine this in Macro Express. Nor is there a straight-forward way to force the refresh. You might be able to force a refresh by doing the Repeat with Folder command twice like this: Repeat with Folder Repeat End Repeat with Folder // Do your macro stuff here Repeat End We are unsure whether this will work. If you try it, please report back with the result. Another possibility would be to use either the Open Folder or Open Folder in Explorer to open an explorer window and then do a Text Type: F5 to do a refresh.
  23. I suggest you try something like this: Variable Set String %T99% "" Variable Set String %T80% from Prompt ASCII File Begin Process: "attorney.txt" (Comma Delimited Text ) If Variable %T1% = "%T80%" Variable Set String %T99% "FOUND" Break End If ASCII File End Process If Variable %T99% <> "FOUND" Text Box Display: TaxID Not Found Macro Stop End If // Here T1 through T9 should contain the information you want Inside the ASCII File Begin Process command the 'Start Processing Record' is set to 1 and 'Process all Records' is checked.
  24. How big is the file Attorneys.txt? It must be massive for the macro to pause for 30 seconds. Perhaps the macro priority is set kind of low? I would suggest you download Tweakme3.mxe from www.macros.com/downmore.htm and experiment with a different setting for macro priority. You are retrieving the record 9 records beyond the one you entered with a TaxID. you ask for a TaxID and then, because you have set the Number of Records to Process to 9, you loop 9 times in the ASCII File Begin Process: "Attorneys.txt" (ASCII Delimited Text ) command. This will retrieve prompted record + 9. I do not have your file Attorneys.txt but I would guess that a TaxID would be something like 10 digits in length. If you are entering a 10-digit number in the Variable Set Integer %N80% from Prompt command, then you are telling the ASCII File Begin/End Process loop to look at line (record) number 12-34567890. Are there that many records? Are the TaxID numbers in sequence? Do you have records 0000000001 through 1000000000? To see what is going on I suggest you do the following to debug: - Change the Text Box Display command within the ASCII File Begin/End Process to display variables T1 through T10. - Run the macro and enter a lower number when prompted for the TaxID by line Variable Set Integer %N80% from Prompt. Something like 1 or 8 or, depending on the number of records in the file, 100. You should see that the ASCII File Begin/End Process is processing 9 records beginning with the one you entered when prompted. Depending on your needs, you may decide to change the Number of Records to Process to 1.
  25. David, I had exactly the same issue when we were creating the Window Control commands. The Variable Set Control Text command is meant to do what you need. Try this: Use the Get Control command to get the control information for the button. Use the Text method for the control by making sure 'Get Control Using Text' is selected in the Get Control Utilitity. Do not worry about the actual text that appears on the component (button). In your macro, use the Variable Set Control Text to select which text should appear in the control. We have a program that has a single button with a caption that changes; the button can display Done, Print, Save, or EMail. The Variable Set Control Text command allows me to write a macro using a single Control variable and change the Text of the Control variable to match the caption on the button. However, if the control cannot be identified using the Text method of getting the Windows control then this method will not work.
×
×
  • Create New...