Jump to content
Macro Express Forums

rberq

Members
  • Posts

    1,201
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by rberq

  1. Dunno. But here's a simple macro to display the windows as ME sees them. The list of windows (following the macro) is from Windows 7, and also shows many duplicates. Notice also that two windows show as being on top. Sometimes there will be more than two on top. Log Message to Default Error Log Log Errors // // Display all open windows // // // .... set up CR-LF in T98 Variable Set %T98% to ASCII Char of 13 Variable Set %T99% to ASCII Char of 10 Variable Modify String: Append %T99% to %T98% // Variable Set String %T1% "" Variable Set String %T2% "" Repeat with Windows: Place title in %T1% [with alphabetic sort option] If Window Title "%T1%" is on top Variable Modify String: Append " *** This window is on top ***" to %T1% End If Variable Modify String: Append %T1% to %T2% Variable Modify String: Append %T98% to %T2% Variable Set String %T1% "" Repeat End // Text Box Display: List of open windows [display %T2%] // // // Done - exit Macro Return .NET-BroadcastEventWindow.2.0.0.0.33c0d9d.0 ApMsgFwdWindow ApUsbPnP Battery Meter BluetoothNotificationAreaIconWindowClass C:\Program Files\DellTPad\Apntex.exe CiceroUIWndFrame CiceroUIWndFrame ConnectionMgr notification sink ConnectionMgr notification sink DDE Server Window Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME Default IME DropboxSystemStatusMonitorShellHook DWM Notification Window Elara Europa GDI+ Window GDI+ Window GDI+ Window GDI+ Window HiddenFaxWindow HkWndName HotStartUAWindowClass Hsm sink window Hsm sink window Intel® USB 3.0 Monitor Jump List Macro Express Macro Express Player Mail *** This window is on top *** MCI command handling window MCI command handling window MCI command handling window Media Center SSO Microsoft Security Essentials MS_WebcheckMonitor MSCTFIME UI MSCTFIME UI MSCTFIME UI MSCTFIME UI MSCTFIME UI MSCTFIME UI MSCTFIME UI Network Flyout nsAppShell:EventWindow PersistWndName Press enter to open the Dropbox menu Program Manager QuickSet Yahoo Mail - Mozilla Firefox *** This window is on top *** Sigmatel-IDT-SysTray Start Start menu Task Host Window Task Host Window Task Switching TF_FloatingLangBar_WndTitle Timer notification sink Timer notification sink TrayIconWindow Untitled - Notepad X
  2. I use ME3 with Windows 7. I routinely set Mouse Speed to 30ms in most macros -- seems to work well in most situations. With that setting, the test macro takes 9 or 10 seconds, like others are seeing. With Mouse Speed 0ms, the macro runs for half a second. If I eliminate the "Delay 1 Milliseconds" command inside the loop, execution is almost instantaneous. Including the Get Pixel Color, or removing it, has no noticeable effect on timing. Mouse Speed: 0 Milliseconds Mouse Move Screen 10, 600 Repeat Start (Repeat 500 times) Mouse Move Position 1, 0 Get Pixel: Under Mouse into %N1% Delay 1 Milliseconds (so what is this for, anyhow?) Repeat End
  3. I have seen applications that appear to go directly from one window to another, but in fact transition through an intermediate window. In other words, the app might go from window A to B to C, then when you click a button to exit from C back to A, B is activated just for an instant. You never actually see B on the screen, but if there is a macro tied to B it will run and cause you all manner of confusion during debugging. Only way to see what is happening is to have each macro write to the ME log. I guess that has little or nothing to do with your Text Box issue, I just wanted to share my pain. I HAVE noticed that when I tell the Text Box to keep focus, it doesn't keep it if I Alt-Tab to another window.
  4. With oddities like this I try to work around them rather than bull through. Instead of having your macro start PSP directly, try launching a batch file that starts PSP. You may or may not need an EXIT command in the batch file. Worth a try, though it sounds like it won't help because it's sort of equivalent to starting PSP from the Run box which you have already done. Oops! I see that the Corel forum folks suggested the same thing. Great minds run in the same channels.
  5. Slower than cold molasses running up a hill, as my Dad liked to say. I run a batch job periodically, especially soon after booting, to kill various processes and services. See below. One of the Adobe services, I don't remember which, would periodically bring the machine to its knees. * Stop Spybot Search and Destroy Services and Tasks rem pause Must run this job as Administrator net stop SDScannerService net stop SDWSCService net stop SDUpdateService net stop "Spybot-S&D 2 Updating Service" taskkill /F /IM SDTray.exe taskkill /F /IM SDImmunize.exe * Stop Miscellaneous Services taskkill /IM WebcamDell2.exe rem Dell Stage Remote taskkill /F /IM StageRemote.exe taskkill /F /IM StageRemoteService.exe taskkill /IM stage_primary.exe taskkill /IM stage_secondary.exe taskkill /F /IM AdobeARM.exe net stop "Adobe Acrobat Update Service" net stop "AdobeActiveFileMonitor9.0" taskkill /F /IM "AAM Updates Notifier.exe" net stop "Bluetooth Service" taskkill /F /IM BTTray.exe net stop "Intuit Update Service v4" net stop "Nero Update" rem pause
  6. I still use ME3. I never got the Clipboard Paste option of Text Type to work consistently, with or without Simulate Keystrokes, so I don't use it. For that matter, I have also had trouble using Ctrl-V to paste from the clipboard, so I don't do that with ME either. Just plain old Text Type is good.
  7. Your last IF block gets executed every time, and since 15 is always less than 20 you will always end up with 20 in %N10%. How about this: Variable Modify Integer : Copy %N1% to %N10% If variable %N2% > variable %N10% Variable Modify Integer : Copy %N2% to %N10% End IF If variable %N3% > variable %N10% Variable Modify Integer : Copy %N3% to %N10% End IF I'm not familiar with using SWITCH without CASE, so I don't know what you have in mind with the SWITCH statements.
  8. Here's a brute force method: In the Macro Express "Help" screens, look up the Repeat With Folder command. Each time through the repeat loop your macro will be passed a file name (with full path if you checkmark the box). The macro can then use Program Launch to start Microsoft Word (once for each file name), passing the .doc file name as the parameter. You will have to look up just what format the parameter takes -- Google is your friend for this. If there are embedded spaces within the file path and name the whole thing will probably have to be bracketed by double-quotes. After launching Word, the macro can issue keystrokes to highlight all and copy to clipboard and then exit from Word. Macro then can Alt-Tab to Excel, paste, and ENTER to drop down to the next cell in the column. The macro will then go through all of the above for the next file, and so on. The Repeat With Folder loop will end itself when there are no more files. (For the first time through, just manually position Excel by mouse clicking on the first open cell, prior to starting the macro. Or if you want to get fancier and figure out how to position to the open cell, go ahead, and let us know how you did it.) Your biggest problem here will likely be timing -- copy to clipboard, and pasting, and Alt-Tabbing between applications, can take unpredictable amounts of time that may vary widely between one file and the next. You may want to insert some Wait Time Delays between steps, or Wait For Window Title, or both. Good luck, let us know how it comes out or if you run into snags.
  9. I don't quite understand. (1) Do you want each file to be pasted into its own cell, so you will be adding 4000 cells to column A of the one spreadsheet? (2) Or do you want all 4000 files concatenated into a single file, adding only one cell to the spreadsheet? (3) Or do you want to end up with 4000 spreadsheets each representing one of the original files? (4) Do you want to paste into the last empty cell of column A, or into the first empty cell?
  10. In your simple macro, write a message (with time stamping) to the ME error log as the first line of the macro. Log Message to Default Error Log Then write another message immediately before and immediately after the Text Type command. Get a clock with second hand running on the screen and initiate the macro exactly on a five or ten second mark or whatever. Then review the log and see if it tells you anything useful as to where the delay is occurring. In ME Options - Preferences check your settings for Delays. Compare between the computer(s) where it works right and the one where it doesn't.
  11. Copy to clipboard and paste into Notepad, show us the Notepad data here, and we can probably suggest how to edit out the pieces you want to get rid of.
  12. Well, yeah, you're welcome, but did it work? The proof of the pudding is in the eating.
  13. Here's a method that's a little crude, but it worked when I tested it in Firefox and Chrome. IF you know the tab title, you can treat it like a window title. Let's say the tab title you want to close contains the words "real estate". Your macro can mouse-click sequentially on each tab at the top of the screen, moving left to right, to highlight each tab. Then after each click, say If Window Title "real estate" is on top Text Type: <CTRLD>w<CTRLU> End If You have to be careful where you click on the tab, so you won't click on the "x" that closes it. I found that clicking near the top edge worked best. Also, tab width will vary -- get narrower -- if you have lots of tabs open, so the increment as you click left to right has to be small enough not to jump right over a tab. This also means you may click on the same tab more than once, but if it is not the tab you want to close then the macro will just ignore it each time. I didn't test timing, so I don't know whether this will be fast enough if there are many tabs open. Also there may be a slight delay after you click and before the tab is active, so you may have to include a short delay before checking window title. Probably best to close your eyes while the macro is working so you won't be dazzled by all the tabs flashing by.
  14. Here is a simple loop that waits up to 30 seconds for a page to load, based on knowing that a yellow icon will appear when the page has loaded. As soon as the color appears the macro exits from the loop and does whatever else has to be done. This might or might not work for you depending on the page. For example, if the yellow icon appears but the page has only partially loaded, the macro's subsequent actions might fail. Mouse Move Screen 519, 553 Repeat Start (Repeat 3000 times) Get Pixel: Under Mouse into %N1% If Variable %N1% = 52479 Repeat Exit End If Delay 100 Milliseconds Repeat End
  15. Gee, Cory, I don’t know, it sounds like you were still riding your tricycle when I started with computers in college in the late 1960s. The only VAX I worked with was in the 1990s and I was surprised to find it was a real computer. I started with IBM mainframes so anything smaller than 40 refrigerators was just a toy, and that attitude died hard with me. We got rid of our last mainframe in 2007 and it was down to the size of a college dorm icebox; even the AS/400 “midrange” machine was bigger. Around that time I spent a few years using ME to do screen-scraping and pasting among Citrix server, AS/400, and mainframe applications. We had between 300 and 500 ME licenses active every day. I’m a hard core ME3 user – ME Pro was too new and bug-ridden when I tried to convert our functions, and a lot of macros turned out to DEPEND ON the limitations of ME3. AS/400 was overall a good machine to program but paradoxically one of the tougher terminal emulators to integrate ME with. I have used ME for many years as a productivity tool -- I always told my managers it was worth half a person in time and efficiency improvements. Sorry to subject the rest of you to this dissertation, but us old f*rts have to reminisce.
  16. The last "AS/400" I used was named the iSeries, and the IBM emulator was called iSeries Access. It used the TN3270 protocol sort of under the covers, as did other vendors' 5250 emulators. Who knows, IBM may have renamed iSeries to something else by now. I don't recall having your specific problem copying fields. However it often was easier to use Cory's technique of grabbing the whole screen, then extracting the needed data. Using other methods, like tabbing around the screen, would screw up cursor positioning and upset the user. For analysis purposes, do the following MANUALLY (not using ME at all): (1) get the screen set up as your macro will be working with it, including a letter in the field you are having issues with. (2) type Ctrl-a and see if it highlights the whole screen. (3) Ctrl-c to copy to clipboard. (4) Paste the clipboard into Notepad and see what you have. If you can see the field(s) you want, then you can figure out how to pick them up with a macro, probably by pasting the clipboard into a ME variable, searching for [the location of] the label field that precedes the needed data, and based on that location copy the data field to another ME variable. If you have a hex editor it might help you, because the copied screen may contain unprintable characters, but you probably won't have to go that far.
  17. Well here's a fresh idea for you to play with. Write a macro whose hot-key is the Down Arrow. Allow only one copy to run at a time. Macro consists of something like this: Keystroke Speed: 30 Milliseconds Mouse Speed: 30 Milliseconds Text Type: <SHIFTD> Delay 3 Seconds Text Type: <SHIFTU> Macro Return Tap the Down Arrow twice. The first tap starts the macro, which simulates pressing and holding the shift key. This first tap is captured by ME and used to fire the macro, so it is not interpreted by the application as a keystroke. The second tap of the down arrow, which you press and hold rather than release, is acted upon as a keystroke for up to three seconds, or however long a delay you code. I have not tested this in Google Earth since I don't have that installed. I have tested in MS Word and other applications -- the typomatic feature of the down arrow takes effect. If my macro does both SHIFTD and ALTD, then the second press of the down arrow is ignored in MS Word -- don't know whether it would likewise be ignored in Google Earth, or maybe it would work. You could add code at the beginning of the macro to see if the application (window?) is Google Earth, and if not then have the macro type the Down Arrow and quit. That way it would not disrupt use of the Down Arrow in other applications. Or, I suppose the macro hot-key could be something other than the Down Arrow. The critical feature is that the macro itself does NOT try to simulate pressing the down arrow, it only does the shift and/or shift-alt.
  18. What program do you want to read the time from? If it is a program you wrote, you could modify it to put out a file with the time, and your macro could access the file. For testing, use Notepad to make a .txt file containing a time and have the macro read that file. From your other program you could also launch meproc.exe or macexp.exe with the /A or /MXE options to run a macro whenever the program wants the macro to run. See Help screens.
  19. Schedule it to run like Alan said. But while it will run every five minutes, I think it will be five minutes from the last time it ran -- not necessarily right on the clock increments of 10:00, 10:05, 10:10, etc. If you want it to do stuff only at the five-minute marks, I recommend you schedule it to run every minute, and at the beginning of the macro find out the time (minute) like this: Variable Set Integer %N1% from Current Minute Then check N1 and if it is NOT 00, 05, 10, ... 55 return from the macro without doing anything further. This technique should make it do its work only on the proper minutes, but still I don't think it will run EXACTLY at the beginning of each minute (00 seconds). If you need that, we can probably come up with a refinement to do it. Be sure to go to Options / Preferences / Scheduler and set it check at increments smaller than 60 seconds.
  20. Nothing is easy. Until it's done, then it's obvious.
  21. Getting somewhere, yes. But maybe you need still another layer upon layers? Worse than Alice in Wonderland. Here’s a brief excerpt from the web (link to the site is after the excerpt). The way I interpret this is, your existing batch file should have the DISKPART command with the /s option, and the subsequent commands should be in a separate text file. To start a DiskPart script, at the command prompt, type: diskpart /s scriptname .txt where scriptname is the name of the text file that contains your script. To redirect DiskPart's scripting output to a file, type: diskpart /s scriptname .txt > logfile .txt where logfile is the name of the text file where DiskPart writes its output. https://technet.microsoft.com/en-us/library/cc766465%28v=ws.10%29.aspx So your batch file would be simply something like this: PAUSE diskpart /s c:\dpscript.txt PAUSE AND you must make file c:\dpscript.txt containing the commands: select volume 5 assign letter=S list volume select volume 1 assign letter=T I don’t know whether you will see the output from DISKPART on the screen, as it runs, or not. You might need to pipe the output to a log file as indicated in the example, then look at the log afterwards to see what happened. diskpart /s c:\dpscript.txt > c:\dplog.txt
  22. I have done it many times – but not in Administrator mode. You are trying to have Macro Express run cmd.exe so the program path should be c:\windows\system32\cmd.exe When cmd.exe runs, the parameter it will act upon is (with your new name) /c C:\1\DISKPAR2.BAT In other words, all that your macro does is – indirectly – launch a batch file. It is the batch file, NOT the macro, that runs DISKPART. (The first line of your batch file is DISKPART.) The batch file, once started, runs totally independently of Macro Express. Unfortunately the batch file that runs DISKPART must run in admin mode. Sorry, I missed that point about DISKPART in my earlier replies. Here’s a link to how to do that, by creating a shortcut to run the batch file. http://superuser.com/questions/788924/is-it-possible-to-automatically-run-a-batch-file-as-administrator So you have to go another layer down and have your macro launch the shortcut rather than the batch file itself. Don’t you love Windows? When I tried this it DID work, but popped up the Windows box requesting that I authorize changes to my computer. I haven’t been able to get it to run without that manual intervention – maybe if you run ME itself in admin mode as someone suggested above??? At any rate, put PAUSE statements at the beginning and end of your batch file, so it will stop for you to look at it when (if) it runs.
  23. The batch file you built looks fine -- just the commands you would type in a DOS window if you were doing it manually. For debugging, I always like to use PAUSE as the very last line of the batch file, so the command window won't close before you have a chance to look at it. Once you are happy with how everything is working you can remove the PAUSE. However, the system does not like embedded blanks within the batch file name. In the program launch parameters, try it like this with double-quotes around the path-name: /c "e:\My Documents\DISKPART ASSIGN S+T TO VOL 5+1.BAT" And it is /c or /k you need at the beginning of the line, not /e. When I run my test macro with /e, it opens the command window but does nothing further, just like when you did it. P.S. I am using the terms "DOS window" and "CMD window" and "command window" interchangeably. Sorry, I don't know which is currently the accepted term, but I pre-date DOS so that's what I am used to.
  24. Put the commands into a batch file, for example c:\temp\cmdlist.bat Then your macro can run cmd.exe with the parameter "/c c:\temp\cmdlist.bat", which runs the DOS batch file. Click to expand the image below. If you need to dynamically build the batch file with commands that vary from one time to another (rather than code it once ahead of time), you can do that with the ME file commands, or by opening Notepad and using ME text-type commands to build the batch file that way. (Because Notepad is a Windows application, the text-type commands work perfectly well there.) Then save the Notepad file by having ME type the file-save commands, and run the batch file as indicated above.
  25. Good suggestion. When I insert debugging code, I almost always disable the lines when done rather than remove them, because I probably will need them again someday.
×
×
  • Create New...