Jump to content
Macro Express Forums

acantor

Members
  • Posts

    1,534
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by acantor

  1. Tab works if focus begins in the Search field. Otherwise, you'll need to "landmark" on a fixed object before tabbling. Perhaps this? Ctrl + F (Search text box) Tab or Alt + D (Address bar) Tab Tab
  2. The OP did mention that he's using an older version of Firefox. So hotkeys and key sequences might be different.
  3. Maybe the 250 ms delay is not enough. This sequence of keystrokes also navigates to "Import and Backup"... Alt + O // Organize Left arrow Is it possible the hotkey you have assigned to start this process conflicts with another hotkey? Have you created a different macro that is triggered by pressing Alt + i ? If it's truly a focus problem -- and I notice more focus-related issues in Windows 10 than in any previous version of Windows -- adding this step after calling up the Library window might help: Window Activate: Library <WINDOW ACTIVATE Title="Library" Exact_Match="TRUE" Wildcards="FALSE" _IGNORE="0x0006"/>
  4. The hotkey for Test Run is F9, and the "OK" button is activated by pressing Enter. So press F9 followed immediately by Enter. Or, there is a setting that prevents the "Start Debugger" window from appearing:
  5. Text Type (Simulate Keystrokes): <ALTD>I<ALTU> (import/backup) I wonder whether the capitalized "i" is the problem. You may be sending Alt + Shift + i instead of Alt + i. So experiment with these two alternatives: Text Type (Simulate Keystrokes): <ALTD>i<ALTU> or Text Type (Simulate Keystrokes): <ALT>i
  6. It's been a very long time since I last wrote or used a batch file! Is it possible that the failure is due to the batch file running before Macro Express is ready? To troubleshoot, temporarily remove the batch file from the start up group. Manually run the batch file AFTER you are certain Macro Express is loaded. Ensure Macro Express in the startup group. When Macro Express is fully loaded, its icon will be in the System Tray. Also, assuming your macro is hotkey activated, check whether it runs reliably and consistently when you press the hotkey.
  7. This challenge is arguably more of a mid-week diversion than a real challenge. But I thought others might enjoy this not-too-hard puzzle. I recently updated an email mailing list consisting of about 1000 addresses. The list looked like this... Note that each line appears in one of four formats: Name <email@address> <email@address> email@address not an email address (e.g., #Bingo!) The challenge: use Macro Express to simplify the task of cleaning up the 1000 lines so that each line consists only of an email address: Any line that is not an email address, such as "#Bingo!" or a blank line, should be removed.
  8. This might be an important clue. Please describe how you call the macro from a batch file. Is the only time you need to run this macro when you start your computer?
  9. A macro that interacts with an application's user interface cannot be 100% reliable. There are endless ways things can go wrong: a program might fail to launch, a screen might not appear in time, another application might steal focus, and so on. So if your macro ALMOST always works, consider it a success!
  10. The code looks fine. Your comments are clear. The only change I would suggest is increase the delay on Line 3 to four or five seconds. Some applications need a lot more than a second to fully load. You may need a longer delay on Line 18, as well. Once you find the delay that reliably opens the window, you may be able to shorten other delays. Typically I don't add delays when tabbing around.
  11. Hi Stephen, Maybe start with this three-line macro, which shrinks the current window by a set amount: the window will be 50% less wide, and 60% less high. You can change the values to suit your needs. The key point is that negative values decrease the size of the window, and positive values increase it. If the macro works, then make a second macro that uses positive numbers. Use one macro to shrink the window, and the second macro to enlarge the window. These two macros may not be exactly what you're looking for, but hopefully, the solution will be good enough. If you're new to macro scripting, rberq's more versatile solution might be a lot to take on. Variable Set Integer %WidthPercent% to -50 // Shrink or enlarge the window width by this percentage Variable Set Integer %HeightPercent% to -60 // Shrink or enlarge the window height by this percentage Window Resize: <Current Window> Enlarge/Decrease by %WidthPercent% percent, %HeightPercent% percent <VARIABLE SET INTEGER Option="\x00" Destination="%WidthPercent%" Value="-50" _COMMENT="Shrink or enlarge the window width by this percentage"/> <VARIABLE SET INTEGER Option="\x00" Destination="%HeightPercent%" Value="-60" _COMMENT="Shrink or enlarge the window height by this percentage"/> <COMMENT/> <WINDOW RESIZE Option="\x00" Partial="TRUE" Wildcards="FALSE" Method="\x02" Width="%WidthPercent%" Height="%HeightPercent%" _IGNORE="0x0006"/>
  12. "Script" tab "Macro Control" "Comment" It would be helpful to see your entire script. Instead of a screen shot of the Script Editor, select the code in the Script Editor, copy it, and paste it into the forum.
  13. It looks like your script is using a "Text Type" instruction as a comment. If you are, then your script may be sending keystrokes that might gum up the works. In Macro Express, you can sprinkle a script with comments, you can include comments for individual instructions, or you can do both. If you include a comment with an instruction, make sure the instruction is doing what you want it to do. // This is a comment Text Type (Simulate Keystrokes): Hello // This is a comment for a "Text Type" instruction Mouse Move: 5, 5 Relative to Last Position // This is a comment for a "Mouse Move" instruction Delay: 100 milliseconds // This is a comment for a "Delay" instruction // This is another comment
  14. Try this path to chrome.exe instead of the path you're using to Chrome_proxy.exe: C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
  15. For all of its strengths, Macro Express is not the best tool for interacting with web content. There are techniques that one can use to identify and/or navigate to specific web controls, but these techniques are not programmatic. They involve fancy footwork: hunting for pixel colours, monitoring mouse pointer shapes, searching for static text, identifying "neutral" zones on a webpage that when clicked reset the tab order, making inferences about what is going on from the address line or title bar, tabbing or shift tabbing around... and combinations of all of the above. These techniques can be made to work, but it's a slog. (A fun slog, but a slog nonetheless!) The solutions are rarely generalizable: they might work reliably for one web application or one webpage, and stop working the moment a developer starts messing with the CSS or revising the labels for web controls. I can't count the number of times that I've been forced to completely revise the Macro Express scripts that I use to drive outlook.com via keyboard.
  16. Thank you, rberq! Yet the approach you mentioned -- open a copy of the file rather than the original -- has merit, and I might try it. I can tell you about an approach that I thought was promising. But I couldn't get it to work: 1. Extract the path to the selected file from the Address line: %Path% 2. Extract the name of the selected file through its properties: %FileName% 3. Use Macro Express to launch WordPad, with "%Path%\%FileName%" as its parameter.
  17. Here's my solution. 1. Open your "SendTo" folder. How? Press Windows + R. This will bring up the "Run" dialog box. In the "Open" field, type: shell:SendTo Press Enter, or click the "OK" button. File Explorer will open the SendTo folder for your Windows account. 2. Ensure the SendTo folder includes a shortcut to WordPad. If a shortcut to WordPad does not exist, navigate to this folder: C:\Program Files\Windows NT\Accessories\ Scroll down to "wordpad.exe," make a shortcut, and move the shortcut to the SendTo folder. Rename the shortcut "WordPad". Suggestion: If there are other objects in the SendTo folder that start with the letter "W," rename them. 3. Create a new Macro Express script triggered by your hotkey of choice. Set the scope to Window/Program. Specify EXPLORER.EXE as the program. 4. Insert this code in the Script tab: Text Type (Simulate Keystrokes): <APP> Delay: 100 milliseconds Text Type (Simulate Keystrokes): n Delay: 100 milliseconds Text Type (Simulate Keystrokes): w <TEXT TYPE Action="0" Text="<APP>"/> <DELAY Flags="\x02" Time="100"/> <TEXT TYPE Action="0" Text="n"/> <DELAY Flags="\x02" Time="100"/> <TEXT TYPE Action="0" Text="w"/> What it does: 1. Press the hotkey to open the context menu for the selected object; 2. Choose "Send to" from the context menu. 3. Choose "WordPad" from the submenu.
  18. You may need to insert a delay before the macro outputs Tab. Start with one second. Then through trial and error experimentation, see if the delay can be shorter without sacrificing reliability. It might be possible for Macro Express to directly act on the button without the need to tab, but the method is hard to explain, and it only works in certain applications. Read Help on the "Get Control" instruction.
  19. Sure. If the shortcut exists as an icon somewhere on your computer, then it's got the ".lnk" extension. Then use the "Program Launch" option in Macro Express: Program Launch: "SendLeap.lnk" (Normal) Parameters: There is another option that doesn't involve Macro Express. Place the shortcut on the desktop. Open its properties, and enter a "Shortcut key." Pressing that key combination will launch the shortcut, even when the Desktop isn't exposed.
  20. Hi John, In Outlook, you have the option to add a "Quick Step" in the "Message" ribbon called "Create a task with attachment." I think this does what you want. When setting up the new Quick Step, you can assign one of nine "Shortcut keys" to activate it: Shift + Ctrl + 1, Shift + Ctrl + 2, etc. Once you set up the shortcut, you don't really need a macro, as the shortcut key will do it all. However, if you want to use a different hotkey, create a Macro Express script that is activated by, for example, F10. Have this macro output Shift + Ctrl + number, and you should be good to go!
  21. Copying the file and opening the copy is not what I did, but it's worth considering. Normally I open an old file, read it and/or copy something from it, and then exit without saving. I don't want to modify my old files. So maybe this kind of logic? 1. Copy the selected file. 2. Paste the copy in a temporary folder. 3. Rename the copied file: append .txt or .rtf (or whatever) to the end of the file name. 4. Open the renamed file.
  22. I wouldn't have needed a macro had I taken the time to associate hundreds of file extensions. The files were created when one could choose almost any combination of letters, numbers, and symbols for the three-letter extension, including none. The macro circumvents the need to set up associations manually, or on-the-fly. Check out these extensions in a folder of files from 1993... Although I made the macro to handle old files, I find it a handy way to open "modern" file types that I occasionally but rarely access, e.g., .css .html .ahk
  23. I have text files on my computer from a bygone era. Virtually all of the filenames have obsolete extensions such as... .mss .spr .wp4 .spm Some of my files don't even have extensions. (My recollection is that filename extensions were optional during the MS-DOS age.) Modern programs such as Word and WordPerfect don't recognize antediluvian file types and/or files without extensions. Ditto for basic text editors such as WordPad or NotePad. Every time I want to view my old files, I'm forced to do a song-and-a-dance, with far too many steps. The challenge is to use Macro Express to create one hotkey macro for Windows 10 File Explorer. With any file selected, press the hotkey. The selected file opens in WordPad -- or in another program, if you prefer. The macro should open any file with any extension. I experimented with different methods before I settled on a script that works reliably. So I'm so curious what other people come up with. For bonus "points," find a solution that keeps focus on the most recently opened file in File Explorer. In other words, let's say you open the first file in a folder by pressing the hotkey. Close the file. Then press down arrow to select the second file in the folder and press the hotkey to open it.
  24. (Image of a deer caught in a headlight!) I confess... I do this occasionally... but only when the speed penalty is too great. I do for myself, but not for the macros I write for others. I know how to break out of an infinite loop, but my clients usually don't!
×
×
  • Create New...