Jump to content
Macro Express Forums

lemming

Members
  • Posts

    140
  • Joined

  • Last visited

Everything posted by lemming

  1. Hi you could achieve this by creating/updating an environment variable which is readable by other macros, for instance, MacroAisRunning=YES. The relevant commands are: Variable Modify String -> Save to Environment Variable Variable Set String -> Set from an Environment Variable For example if you have Macro A and Macro B, you can get Macro A to set MacroAisRunning=YES right after it is launched. Macro B can read this environment variable to check if Macro A is running. Remember to set MacroAisRunning=NO before terminating Macro A. You can also achieve this by saving macro statuses to INI files or text files, though this requires disk access.
  2. Hi what is your hotkey? Perhaps Paradox is already using it, so that could be why it won't work there. Try another hotkey, and also check the Pardox documentation/help for a list of its hotkeys.
  3. This is a known problem and it even affects scripting languages like autohotkey. The obvious workaround is to make the leftmost monitor the main. If your user is not willing to do this, another solution might be to temporarily move the window to the main monitor, perform the needed operations, then move it back to the secondary.
  4. Hi Terry, I just came across this topic. Hopefully you already have a solution. Anyway, I played around with AHK and came up with a regex one-liner to glean the data you wanted. alltext := RegExReplace( alltext, "s)\[([^\]]+)\.jpg\][^\[]*- COMMENT -.{0,2}\n" , "$1.jpg`n" ) This regex captures the filename in between the square brackets, then it discards everything that is between .jpg and - COMMENT - (inclusive). Whatever that is left is the result you wanted. I've attached a zip with two files, an .ahk file (with comments) and a text file containing the data you posted. Both files need to be in the same folder. Terry data.zip
  5. Hi, you could save yourself a lot of trouble and make your script more reliable by launching an Google advanced search URL instead of trying to type in stuff. For instance, here is the direct URL to search for the word "transition" in the site that you listed. https://www.google.com/search?as_q=transition&as_qdr=all&as_sitesearch=http%3A%2F%2Fsupport2.magix.net%2Fboards%2Fmagix%2Findex.php%3Fshowforum%3D113&as_occt=any&safe=images Most of it looks like gobbledegook, but it is quite straightforward. All the stuff after /search? are search parameters and each parameter is separated by an ampersand (&). as_q= is the search word and as_sitesearch= is the domain. You could surf the links below to find out exactly what they mean, but you usually don't need to. Here's what you could do: 1. Do a search with the Google advanced search page as you normally would. 2. Copy the resulting URL from your web browser. It'll be a long URL. 3. In a text editor, remove any parameters that are blank, e.g. &as_rights= 4. The URL can now be launched by MEP, saved as a bookmark, etc. It'll take you directly to the search results without the need to type in search strings. More info: Google Search URL Parameters – Query String Anatomy http://www.blueglass...string-anatomy/ Scroll down to Google “Advanced Search” URL Parameters
  6. Hi does your task involve copying data from Word or other Rich Text program? Or maybe copying from a live web page? If you then paste this formatted data into a text editor, it may lead to unexpected delays. Some editors have a "paste as plain text" option which should make things faster. Other editors like Notepad++ just discard all formatting and will automatically paste as plain text. I don't use Ultra Edit nor Boxer, so I can't comment on them
  7. Yeah, good points. I realize too that more people are using notebooks these days instead of desktops. The alt-code sequences only work with a numeric keypad, and practically all notebooks lack them. You have to press an additional key to toggle a pseudo numeric keypad, so generating an alt-code sequence might require three hands, depending on the keyboard layout! In this case, MEP or Charmap would be useful.
  8. You can just do this with plain old DOS copy command. Assuming all the text files are in one folder and you want the final file to be in the same folder, you just need cd to the right location and type: copy *.txt mergedfile.txt You can also make use of DOS in MEP to achieve similar results - just use Program Launch with cmd.exe, which is the command-line interpreter, i.e. the Dos prompt. You don't have to include the full path for cmd.exe. You can then put these in the Program Parameters: /K copy "C:\Users\Lemming\Desktop\test\*.txt" "C:\Users\Lemming\Desktop\test\mergedfile.txt" The /K option keeps the Dos window open after the command is finished. This would also pause your script till the window is closed. If you want the window to close immediately, change /K to /C. You'll also need to specify the full path for your files.
  9. Or the alt-code sequence - Alt-0176 for ° No macros needed, nor any other program.
  10. Hi you could have just created a symbolic link to the old directory (like an alias or shortcut), so your macros could just chug along thinking nothing has changed. The Junction utility from Sysinternals does this: http://technet.micro...s/bb896768.aspx But as Cory noted, it's not a good practice to hard-code directory paths! Update: You can also do this in Vista or Win 7 with the built-in Mklink command: http://www.maximumpc.com/article/howtos/howto_use_symbolic_links_master_vistas_file_system
  11. Whoops, you're right. I've somehow overlooked this option in Macex. Suffix keys would do what Daniel requires.
  12. Hi Daniel, sorry to hear about your injury. I think it may be hard for others to imagine dealing with limited mobility and partial access to the keyboard. Macex does not seem to support the "quick-correct" feature. But anyway, you could also set up similar abbreviations in Microsoft Word - the AutoCorrect feature has been available for years. But I get where you're coming from; I used Superkey many years ago too and that "quick-correct" feature was awesome and I could make it work in any program. The only equivalent these days seems to be AutoHotkey. Since it is a rival product I won't link to it but you can always google for it. You'd want to look at its "Hotstrings" feature (needs Windows NT/2000/XP or later). -Lemming
  13. Hi, you can launch the built-in Windows util systeminfo.exe and capture the output in a variable. However, this util can be slow because it tries to gather a lot of other info about your system. Also it only shows "System Boot Time", so you'd have to parse through a lot of other info and also perform additional calculations to determine uptime. On the plus side, systeminfo.exe is installed on every Windows PC (since Win XP I believe), and you do not have to specify its exact location since it resides in the default Windows path. An easier method would be to use the uptime.exe utility which you can get for free at http://uptimeexe.codeplex.com/ It's a command-line util which does not have to be installed. Just copy it to anywhere. It runs in a split second and will report your boot time and also your uptime. I've written a script that parses the info from uptime.exe into separate variables. You can add additional logic for your purposes. -Lemming System Uptime for TsunamiZ.mex
  14. GNU utilities for Win32 Some ports of common GNU utilities to native Win32. In this context, native means the executables only depend on the Microsoft C-runtime (msvcrt.dll) and not an emulation layer like that provided by Cygwin tools. http://unxutils.sourceforge.net/ Includes classic Unix utils for text search and manipulation with regular expressions (regex), such as grep, sed, awk. Other useful utils include wget, tail, head, sort, uniq, etc.
  15. In a related matter, I find that for many public websites, the main cause for slowdowns are ads and ad servers, not the main web server or the main content itself. I installed Adblock Plus and FlashBlock and they've significantly reduced the "slow loading" and "not loading properly" problems. If you're accessing a public site which runs ads, these two extensions could help make your scripts more reliable. http://adblockplus.org/en/ https://addons.mozil...don/flashblock/
  16. Hi you could try Windows's built-in Runas program. It's been around since XP days, I believe. It lets you run any program under a different user account, including as Admin. More info and examples at http://ss64.com/nt/runas.html You can run it using "Activate or Launch". You should not need to specify its exact location, since it resides in \System32, which is in the default Windows path. Anyway, on my system (Win 7), the path is: C:\Windows\System32\runas.exe
  17. Hi I usually don't face problems in activating Word, but I faced a similar situation on one particular computer some years back. I believe it was Word 2003 on XP. My workaround was to launch Word again (i.e. Program Launch, not Activate). This results in Word launching a new instance, with the side effect of Word being activated. If you close that new instance (Window Close), you should be left with whatever Word document that was already open, and it will be in the foreground. Kludgy, but it worked for me. The Word executable is usually WINWORD.EXE. The path will vary. You can also launch Word with the /n switch (no document open), but you'd still need to close the new instance.
  18. Yea, I've seen this quite often. Usually, they're just storing data with no calculations or formulas. Sometimes there aren't even numbers. On their PCs, they almost always have Word too, so I would suggest to them to use Word's tables and its table wizard instead. Data entry is a lot easier in a Word table, and the tables are very customisable.
  19. Excel files are binary files (i.e. not plain text files), so you can't use AsciiFileBeginProcess on them. You might want to check out XLS2CSV: www.brothersoft.com/xls2csv-69870.html Does exactly as its name says. Small, fast and free. You don't even need to have Excel installed. Once data is in CSV format, it is a lot easier to read with MEP. It works from the command line, so you can call it from within macros with the Program Launch command. I've was using XLS2CSV for a project where I needed to extract data from dozens of xls files every day. Publisher's description Microsoft Excel (XLS) file to Comma Seperated Values (CSV) file conversion program. This product helps you to convert your Microsoft Excel files to the standard Readable CSV file format which can be useful for your software or web site.
  20. Just remembered that I came up with an “image capture and compare” solution last year for MEP. This can serve as an OCR replacement, and might suit your purpose if the screen info doesn't change rapidly: http://pgmacros.invisionzone.com/index.php?showtopic=4531 My script uses external programs though (IrfanView and md5.exe), and it is not very fast and needs to save to disk. You might be able to speed things up with a RAM drive.
  21. Like Cory says, if your text appears in exactly the same spot every time, then you may not even need OCR. Anyway, you could use MEP's windows resizing and repositioning commands to ensure this. Does the text also appear in the exact font and color each time? You can think of the search area as a square grid, and each number has a unique layout on the grid. For example, the number 42 has a different layout when compared to 76. So all you need to do is compare pixels at a dozen (or so) precise coordinates, and you'd have a crude form of OCR. MEP should be fast enough to do this every second, or every 1/2 second. Finding out the precise pixel coordinates can be tricky. You will probably need to use Window's built-in screen magnifier (It's just called "Magnifier" in Win 7; I forgot what it's called in earlier versions) and also AutoIt3 Window Spy, a utility which will report the exact coordinates of your mouse cursor. AutoIt3 Window Spy is installed as a part of AutoHotkey_L (http://l.autohotkey.net/).
  22. Yea, I know what you mean. AHK, et al can restrict hotkeys by class. As a kludge, perhaps you could use the "Capture Using the Contents of the Control" which would let you check for unique text in the window you're interested in. If a window doesn't contain the unique text, don't allow the macro to continue.
  23. You don't even need Macex for this. You could use the well known grep program from Unix. For Windows, you can get grep via GNU utilities for Win32 which can be found at http://unxutils.sourceforge.net/ You only need the file egrep.exe which is in \usr\local\wbin For your given example: statusdict /setpage known {statusdict begin 792 1224 1 setpage end} if This one-liner will DISPLAY all lines which match the pattern in the file dirty.eps egrep "\{statusdict begin [0-9]{3} [0-9]{4} [0-9] setpage end\} if" dirty.eps This one-liner will REMOVE all lines which match the pattern in the file dirty.eps and write the results to clean.eps egrep -v "\{statusdict begin [0-9]{3} [0-9]{4} [0-9] setpage end\} if" dirty.eps >clean.eps -v mean invert-match, or select non-matching lines [0-9]{3} means "match any three-digit number" [0-9]{4} means "match any four-digit number" [0-9] means "match any one-digit number" The curly brackets have a special meaning in regex, so you need to "escape" them you're looking for the literal characters. Hence, the use of the backslash char in the search pattern, i.e. \{ \} I regularly have to grapple with extremely huge text files (over 200 million lines, file size 2GB+ each). I processed one such file using a much more complex pattern, and egrep took only about 10 seconds. It may not seem fast, but it is still faster and easier than autoit/autohotkey. Anyway, processing such large files would not be feasible with Macro Express. For your file, which is "only" about 30,000 lines and has relatively simple patterns, I would estimate egrep will take less than a second to perform the task you want. You can also call egrep from Macex.
  24. Just adding on a bit to what Kevin said. You not only need to add delays between actions, but also between keystrokes. I think the <ALTD>vmoc<ALTU> part might be the problem here. As it is, it will just blast 4 keystrokes within a few ms. You might need to separate all the keystrokes, e.g.: <ALTD>v<ALTU> Delay 0.1 seconds <ALTD>m<ALTU> Delay 0.1 seconds (...and so on...) Or you can try the Keystroke Speed command as Kevin suggested.
×
×
  • Create New...