Jump to content
Macro Express Forums

acantor

Members
  • Posts

    1,531
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by acantor

  1. It appears that the developers of your AutoCAD software has made the unfortunate mistake of replacing the tried and true menu system with a confusing ribbon system. I have actually met a few people who prefer ribbons to menus, but they are few in number. Now, back to your problem. It sounds like Macro Express is not "seeing" your hotkey when you press it. When upgrading software from one version to another, sometimes the title bar changes. If you set the scope to window-specific when you originally created the macro, you may need to edit the scope to reflect the new title bar text.
  2. If you need to process a column of cells, "Text Type <ARROW DOWN>" should move down to the next cell. You may need to use <ESC><ARROW DOWN> instead. If there is an advantage to specifying a cell, use "Text Type <F5>"
  3. It's a little unclear (to me, at least) what you are asking. But if I read between the lines a little and take an educated guess, I say this: Macro Express usually intercepts keystrokes before other applications see them. In general, a Macro Express script reliably overrides built-in hotkeys, whether they are native to an application (e.g., Alt + D in a browser to go to the address line), or added to the User Interface, e.g., Desktop Shortcut Keys. The exception is for key combos like Ctrl + Alt + Delete, which Windows sees first, probably for good reason!
  4. I don't know of an *elegant* way to determine the last key pressed when using Macro Express. I can imagine some inelegant approaches, but I doubt they would be practical. Macro Express is extremely versatile, but intercepting keystrokes is not one of its strengths!
  5. You might be able to do this with an application-specific hotkey macro with "Enter" as the trigger. Something like this: Text Type (Simulate Keystrokes): <ENTER> Text Type (Simulate Keystrokes): <ALT><SHIFT> or substitute this for the second line: Text Type (Simulate Keystrokes): <ALTD><SHIFTD><SHIFTU><ALTU>
  6. This problem may not lend itself to a macro solution. The change in mouse cursor may be the result of a Windows setting. The ability to change the mouse cursor direction with a key press is not built into the English language version of Windows. At least, I don't think so! It might be unique for Hebrew, all semitic languages, or all languages that are written right-to-left. Try hunting around in the Control Panel for the applet that controls the behaviour. My guess is that it will be buried deep in the "Region and Language" applet. (Emphasis: I am guessing!) If you change the hotkey to something else -- say, F10 or F12 -- the problem may go away on its own.
  7. This functionality is not built into Macro Express, but it would not be too difficult to script a macro that changes the mouse cursor, either via the Mouse applet in the Control Panel, or via third-party mouse cursor software, such as Biggy.
  8. I am not sure of the technical language, but this "control" appears to be a child window within the application, similar to the "History" sidebar in a browser, but without a title. The control can be manually resized with a mouse. I thought there may a way to resize it using ME, similar to the way that ME lets me resize the entire application window.
  9. I am using the "Get Control" command to capture a control in %C1%, and later, "Set Focus" to %C1%. This works nicely. But now I would like to resize the control. The way this is "normally" done is to place the mouse over the bottom border of the control, and dragging down. Using Macro Express, I check each pixel from top to bottom until Mouse Pointer becomes "Size NS", and then dragging downwards. It works, but it's a bit of hack. Does anybody know of a way to do the same thing programmatically, rather than manipulating the User Interface?
  10. Is there anything in common between the names of the controls? For example, do they always contain "ABC 123"? If yes, I think it is possible to extract the text of the control into a text variable, and then test it to see whether that variable contains the string that is common to all of your target controls.
  11. I suggest that you start again from scratch. The script to bring a specific window to the foreground should not require more than one or two lines of Macro Express code.
  12. Hi Terry, Obviously, the preferred approach would be to interact programmatically with user interface elements to figure out the name of the window. But this is not always possible, at least not with Macro Express. I have constructed a number of macros for Mozilla Firefox that might be applicable to your situation; I use a workaround because there is no way -- or rather, I know of no way -- to capture the name of a tabbed page. The purpose of these scripts is to estimate the dimensions and positions of the focused tabbed page. The basic strategy is to move the mouse pointer to the top left corner of the window, and then perform a series of pixel hunts to calculate the width and height of the menubar, address bar, etc. based on changing colours. When the macro has done all of its work, the mouse pointer is where it needs to be. The method of pixel hunting/keeping track of variables is definitely a brute force method. But it works reliably and quickly. I would not call this solution elegant, but it works with different window sizes and positions, resolution settings, display settings, and even with different sized monitors. It is not an ideal solution. But until I get a better handle on AutoHotkey, or until the good folks at Insight Software provide us with new functionality, brute force solutions that infer information about the user interface are almost always possible.
  13. One difference is that a macro scoped to winword.exe will be triggered when a Word dialog box is open and focused, or Word is open but no documents are displayed. A macro scoped to "- Microsoft Word" (partial match) will only be triggered if a Word document is open; nothing will happen when a Word dialog box is focused, or Word is open but all document windows are closed.
  14. Try changing the program-specific macro to window-specific. By setting it to "- Microsoft Word", the macro will be recognized in all Word documents. (Every Word file has this text fragment in their title bar.) Then, you can perform different actions in different windows, depending on the titles. Here is one way: Variable Set String %WindowTitle% to topmost window title If Variable %WindowTitle% Contains "ABC" // Do this... Else If Variable %WindowTitle% Contains "XYZ" // Do that... End If End If
  15. You may need to change the activation of the original macro from program specific to window specific. If you can contrive things so that the two window titles are unique, things should work. Another alternative is to use one Word-specific macro, and then test for different window titles... Variable Set String %WindowTitle% to topmost window title Switch( %WindowTitle% ) Case: Document 1 - Microsoft Word // Do this End Case Case: Test document - Microsoft Word // Do that End Case Default Case // Do something else... End Case End Switch
  16. Hi Terry, 1. What happens if you maximize a document window, and then resize it? Can Macro Express still see the window, or does the window become invisible again? 2. As you tried using controls to identify the document rather than its title? Alan
  17. Hi Pat, Thanks for bringing this to my attention. It looks to be a very good tutorial. Alan
  18. Hi Cory, I searched the forums for VBScript, and though I found many mentions, I did not find code samples for extracting the HTML. Where is a good place for a novice VBScripter to start? Related question: I once stumbled upon an on-line tutorial that described, in detail, techniques for interacting with web forms by typing JavaScript on the address line. Now, I can't find it. Can you recommend resources on this subject? Manipulating UIs is a good way when starting macro scripting, but sometimes, it is much better to do the interactions programmatically... but these are not easy skills to acquire!
  19. That is one interesting AutoHotkey command! Thank you for bringing it to my attention. There are some tasks that I end up automating using AutoHotkey, but I much prefer to work with Macro Express, as scripting and debugging are faster and easier.
  20. For some webpages, it is easy to figure out exactly which page one is dealing with by checking the window title: Variable Set String %WindowTitle% to topmost window title If Variable %WindowTitle% Equals "Facebook - Mozilla Firefox" // This is Facebook End If If Variable %WindowTitle% contains "Hotmail" // This is Hotmail End If But some sites, like the most recent incarnation of Hotmail, displays the same title for every page, e.g.: Hotmail - myemailaddress@hotmail.com - Windows Live - Mozilla Firefox (In past versions, the name of the current folder appeared in the title: e.g., Hotmail - Inbox...) I am experimenting with a scripting technique to determine the identity of a webpage by checking for unique text in the source code. Here is the script for Firefox: Clipboard Empty Text Type (Simulate Keystrokes): <ESC> // Cancel menu operation Text Type (Simulate Keystrokes): <CONTROL>u // Show source Wait for Window Title: Source of: // Wait for source window to appear Text Type (Simulate Keystrokes): <CONTROL>a // Select all Text Type (Simulate Keystrokes): <CONTROL>c // Copy Text Type (Simulate Keystrokes): <ALT><F4> // Close source window If Clipboard Contains "View New Content" // Text is found, so do something Else // Text is NOT found, so do something else End If Here is the script for Internet Explorer: Clipboard Empty Text Type (Simulate Keystrokes): <ESC> // Cancel menu operation Text Type (Simulate Keystrokes): <ALT>v // "&View" menu Text Type (Simulate Keystrokes): c // "Sour&ce" Wait for Window Title: - Original source // Wait for source window to appear Text Type (Simulate Keystrokes): <CONTROL>a // Select all Text Type (Simulate Keystrokes): <CONTROL>c // Copy Text Type (Simulate Keystrokes): <ALT><F4> // Close source window If Clipboard Contains "View New Content" // Text is found, so do something Else // Text is NOT found, so do something else End If This technique works nicely if the source contains a unique text string that uniquely identifies a page. But it bothers me that the source window appears briefly. I have tried minimizing the window of source code, hiding it, and moving it off screen. But it is always visible. The effect is rather flashy. Do you know of more elegant ways to save the source to a variable without bringing up a second window?
  21. Something like this? This script prompts for the header each repeat, but the value of %Header% can probably come from elsewhere: Variable Set String %Header% to "Start" Repeat Until %Header% Equals "" Text Box Display: %Header% Variable Set String %Header%: Prompt Update Textbox: %Header% End Repeat
  22. Check out all of the "Mouse Event" options when you create a new macro. You will find interesting possibilities, like macros activated by left, right or middle clicking a menu, minimize button, scroll bar, and more. Or you can define a rectangle to click on.
  23. There may be better ways to navigate to a target than by clicking the mouse cursor. In many browsers, you can reliably navigate to objects by searching for adjacent text. For example, let's say that you want to automatically sign in to a web site. The task is to move the cursor to the "User Name" edit box, enter your user name, then enter your password, etc. In pseudo-code: // Start a search on the page <CONTROL>f // Wait for the Find box to receive focus Wait 200 ms // Search for the phrase "User Name" Text Type "User Name<ENTER>" // Assume search string was found. Escape out of search Text Type "<ESC>" // A short delay here may make the script more reliable Wait 200 ms // Focus is now on the label next to the field. Tab to it... Text Type "<TAB>" // Enter the user name, tab to the password field, and enter the password Text Type "georgie123" Text Type "<TAB>" Text Type "this_is_my_password" // Activate the "Submit" button. (Pressing Enter does the trick) Text Type "<ENTER>" In certain browsers, there are even more reliable ways to do this. In Firefox, for example, there is a command that searches only for text that occurs within a hypertext link.
×
×
  • Create New...