• Content count

  • Joined

  • Last visited

  • Days Won


Everything posted by acantor

  1. Congratulations on getting so far! There are many ways to make the script more reliable and robust. For the next iteration, consider substituting "Window Activate" commands for Alt + Tab commands. Alt + Tabs work reliably when only two windows are open. But if you more than two open windows, you may end up in the wrong one. "Window Activate" is more likely to bring up the windows you actually want to act on
  2. You are probably on the right track by using program launch and window activate commands. 1. For now, forget about looping through multiple files. Simplify. Get it to work for one file. 2. Insert long pauses after each command. 1 or 1.5 seconds should be plenty. Commands that bring up windows and programs take time to work. Once you get the macro to work. use trial and error experimentation to figure out how short delays can be. Sometimes delays can be omitted. Sometimes they need to be longer than you might imagine. 3. Once you get the script functional, use it as often as possible for a day or two or three to ensure it's reliable. Then, make a copy of the macro, and start adding the code to loop through multiple files, which will add another layer of complexity.
  3. When inserting the Window Activate command, click the "Browse" and select the specific CintaNotes windows you want to activate. Then set the "window title" drop down to "Exact Match." Save the macro and test. If it works, edit the command to work more generally. For example, if the window title is "CintaNotes - Document001" but you want it to work for Document 001, 002, 003, etc., delete "001" and then change the drop down to "Partial Match."
  4. I run Macro Express remotely through a VPN. Macro Express is installed on both machines. If I am interacting with the remote desktop, the remote version of ME is running and I can use it from my local machine. If I am interacting with my local desktop, the local version of ME is recognized. Sometimes there are timing issues when running ME remotely. A script that works reliably may need additional "time shims" when accessed remotely due to internet bottlenecks.
  5. Hi Terry, I wonder if something got corrupted in your installation. Make sure your macro file or files have been backed up. Uninstall Macro Express Pro, reinstall it, and reload your macro files.
  6. The setting in Options > View has been a permanent solution. I checked Options > Preferences and found no settings for the sidebar. Odd that the Sidebar setting doesn't stick for you. Hope you sort it out!
  7. I have kept the sidebar hidden for so long that I forgot it existed! Like you, I find it takes up too much UI real estate. The only thing I might use it for is a shortcut for creating a new macro, but I already have a hotkey macro that creates a new macro. What I did years ago was choose Options > View > Sidebar. The Sidebar hasn't appeared since.
  8. This will get you close, although this version is written in Macro Express Pro instead of Macro Express. So you will need to recreate the code from scratch. Clipboard Copy Variable Set String %T1% from the clipboard contents Variable Set Integer %N1% to the position of "-" in %T1% Variable Set Integer %N2% to the length of variable %T1% Variable Modify String: Copy a substring in %T1%, starting at 1 and %N1% characters long to %T2% Variable Modify String: Copy a substring in %T1%, starting at %N1% and %N2% characters long to %T3% The code works, but it may not be quite what you want. The results, T2 and T3, each contain a hyphen and an extra space. If you want to strip out the hyphen and/or the spaces around it, you will need to add extra lines. There are several ways to do it, but I would likely use a "fudge factor" of 1 or 2, depending on whether there are spaces surrounding the hyphen in the input, and/or whether you are OK with leading or trailing spaces in the output. But let's assume 1. The extra lines will do this: N3 = N1 - 1, and N4 = N1 + 1. Then calculate T2 using N3 instead of N1, and T3 using N4 instead of N1. I hope you enjoy learning about string manipulation! The best way to learn is through trial and error experimentation.
  9. Yes it can be done -- using string manipulation. There are actually several ways to do it, and Rberq has eloquently outlined one approach. I would do it somewhat the same way: 1. Copy the text to the clipboard. 2. Copy the clipboard to a string variable, say, T1. 3. Identify the position of the hyphen with T1, which is an integer, so let's call it N1. 4. Get the length of T1, an integer, so let's call it N2. 5. To obtain the first part, copy from position 1 to N1, and place it in variable T2. 6. To obtain the second part, copy from position N1 to N2, and place it in variable T3. You may need to adjust N1 and N2 to make the script do exactly what you want, e.g., N1 = N1 + 1 or N1 = N1 - 1.
  10. Terry, I believe the shortcut must be on the DESKTOP if you want to activate it via hotkey, not in a folder. (Recognizing that the desktop IS a folder... in Windows 7, it's C:\Users\[Your Name]\Desktop) Ctrl + Alt + 8 is a fine hotkey, and no fancy finger work is needed! For this combo, it's easiest to hold Ctrl and Alt with two fingers with your left hand -- I use (piano) fingers 2 and 4 (or 1 and 2). Then press and release 8 with your right hand, which is free. Finally, release the two fingers on the left hand. It's a bit of a stumble at first, but practice slowly and deliberately, and you will likely find you can orchestrate the presses automatically, in a second or less. It's a skill that nobody is born with. It takes a bit of time to master. These skills are not as hard as acquire as learning to touch type or playing the baritone bassoon!
  11. About 1000 key combinations are available, so keep trying! Most function keys are available, as are many keys on the numeric keypad. But the safest combos are Ctrl + Shift + Alt + something. Few programs require a user to press and hold three modifiers at the same time. Other combos you can use are Ctrl + Alt + something, Shift + Alt + something, and Ctrl + Shift + something. If the shortcut key can be assigned, it will instantly appear in the field as you press that key combination.
  12. That's a tried-and-true debugging technique!
  13. It's unclear from your description exactly what you are trying to do, but let me take a stab at it. It sounds like you want to save a file with a new name, xxx.jpg to xxxCR.jpg. In many "Save As" dialogs, you do not need to include the file extension in the file name. If no extension is specified, the extension is added automatically when you save. Assuming the file name field has focus, you might be able to do this (in pseudo code): TEXT TYPE <END> // Move cursor to the end of the line TEXT TYPE <BACKSPACE><BACKSPACE><BACKSPACE><BACKSPACE> // Delete the three-letter extension and the period TEXT TYPE "CR" // Add the letters C and R TEXT TYPE <ENTER> // Pressing Enter activates the "Save" button in many "Save As" dialog boxes. An alternative to the last line might be something like this: TEXT TYPE <TAB><TAB><TAB><TAB><ENTER> // Tab to the "Save" button, and activate it by pressing Enter
  14. Terry, What happens if you bypass Macro Express's program launching capability, but fool Macro Express into launching the application? 1. Create a desktop shortcut to excel.exe and assign it a shortcut key via its Properties (as described above). 2. Use Macro Express to simulate the shortcut key. For example, if the shortcut key is Ctrl + Alt + E, the Macro Express Script will be: Text Type (Simulate Keystrokes): <CONTROL><ALT>e Are you still seeing delays?
  15. Check the delay when launching Excel natively. 1. Terminate Macro Express. 2. Find EXCEL.EXE on the hard drive, and add a shortcut to it on the desktop. 3. Edit the Properties of the desktop shortcut. Specify a "Shortcut key." Most function keys are available, but I suggest using two modifier keys + an alphanumeric key, e.g., Ctrl + Alt + E. Click OK. 4. Press your new shortcut key, and time how long it takes to launch Excel. Now you can compare the two activation methods -- a Windows-specific technique, and via Macro Express.
  16. You do not need a macro to do this. Old-style DOS commands make short work of the job of renaming files en masse. 1. In the "Run" dialog type "cmd" and press Enter. 2. You should now be at a DOS prompt. 3. Navigate to the folder you want to act on using "cd" (change directory) commands, e.g., cd c:\Users\SSmith\Links 4. To rename every file in the folder, type this at the prompt: ren *.* *.*.txt and then press Enter. Translation: rename (ren) every file in this format: name.extension to this: name.extension.txt The "ren" command will rename the files in a blink of an eye.
  17. Agreed, that would be a helpful feature, especially when debugging. Did you submit a feature request?
  18. If there is consistency in the clipboard text, delete everything that is not a macro name. For example, let's say the clipboard text always is something like this... " 0123456789Colour = Brown " or this... " 0987654321Colour = Red " or this... " 3.14159265Colour = Turquoise " Variable Set String %Clip% from the Clipboard // A series of statements to parse out unwanted text... // e.g., delete leading/trailing white space, the first 10 characters, and the phrase "Colour = " Variable Modify String %Clip%: Trim Variable Modify String %Clip%: Delete a substring starting at 1 and 10 characters long Variable Modify String: Replace "Colour = " in %Clip% with "" Macro Run: %Clip%
  19. The final step is perhaps the easiest. To replace /t/ with /z/...
  20. Macro Express may not be able to "see" anything in the VPN client. You might try activating the VPN window via Macro Express to give it focus, and then clicking a coordinate relative the window. Also try activating the menus in the VPN by keyboard. You might be able to send keystrokes with Macro Express once the window is focused. Try <ALT> + the underlined letter to access a menu, e.g., Alt+F for the "File" menu. If you cannot fully automate the process, partial automation is a fine option. For example, you may need to manually give focus to the VPN region before activating a macro that does the repetitive grunge work.
  21. Copying and pasting between cells and worksheets are not tasks that I usually automate. But if I did, I would make use of built in hotkeys in Excel, e.g., F2 (to edit the current cell); Ctrl + PageUp/PageDown (to flip to the next/previous worksheet), Ctrl + spacebar (to select the entire column), and so on. My favourite Macro Express script for Excel moves an entire row down or up without selecting it, analogous to the two built-in Word commands that move an entire paragraph, without the need to select it first. My scripts assume the same shortcuts for both programs: Alt + Shift + Up/Down. Move Row Up: (Alt + Shift + Up) {Set to activate as soon as the keys are pressed} Lock Keyboard and Mouse Text Type (Simulate Keystrokes): <SHIFTU><ALTU> Text Type (Simulate Keystrokes): <HOME> Text Type (Simulate Keystrokes): <SHIFT><SPACE> Text Type (Simulate Keystrokes): <CONTROL>x Text Type (Simulate Keystrokes): <ARROW UP> Text Type (Simulate Keystrokes): <SHIFT><CONTROL>= Text Type (Simulate Keystrokes): <SHIFTD><ALTD> Unlock Keyboard and Mouse Move Row Down: (Alt + Shift + Down) {Set to activate as soon as the keys are pressed} <LOCK KEYBOARD AND MOUSE/> <TEXT TYPE Action="0" Text="<SHIFTU><ALTU>"/> <TEXT TYPE Action="0" Text="<HOME>"/> <TEXT TYPE Action="0" Text="<SHIFT><SPACE>"/> <TEXT TYPE Action="0" Text="<CONTROL>x"/> <TEXT TYPE Action="0" Text="<ARROW DOWN><ARROW DOWN>"/> <TEXT TYPE Action="0" Text="<SHIFT><CONTROL>="/> <TEXT TYPE Action="0" Text="<SHIFTD><ALTD>"/> <UNLOCK KEYBOARD AND MOUSE/>
  22. Hi Terry, I have had good luck with the Alt+F8 method for running VBA scripts from Macro Express. You are correct, there is no need for such long delays. 10 ms should be enough, and no delay may work fine.
  23. Try saving the control using its "coordinates" (instead of its "z-order.")
  24. If it's a command on a ribbon in an Office product that you want to access, and there is no default hotkey for the command, I find this approach works nicely. In this example, I am automating "Paste Special" in Word. You may need to a short delay between the first and second lines to make it reliable. Text Type (Simulate Keystrokes): <ALT>h // Home ribbon Text Type (Simulate Keystrokes): v // Paste Text Type (Simulate Keystrokes): s // Paste Special... Text Type (Simulate Keystrokes): Unf // Select "unformatted" from the listview (only the first few letters are needed) Text Type (Simulate Keystrokes): <Enter> // Activate the default button (OK)
  25. I have rarely found a reason to use <ALTD> and <ALTU>. I find <ALT> works fine as a modifier key. <ALT> by itself moves focus from the active window to the menu bar, or, if the application uses ribbons, to the ribbon. Little known factoid: <F10> does exactly the same thing. So to activate the File menu: <ALT>f (You must use lowercase f; <ALT>F is equivalent to <ALT><SHIFT>f, which in some applications does nothing; but in some applications it is a hotkey. For example, in Word, <ALT><SHIFT>f changes the style to "Footnote Text Style") Similarly, to activate the Home ribbon: <ALT>h In Macro Express, there are several ways to code these kinds of key sequences: Text Type (Simulate Keystrokes): <ALT>h // Easiest way or Text Type (Simulate Keystrokes): <ALT> // First, move focus to the ribbon Text Type (Simulate Keystrokes): h // Then, activate the Home ribbon or Text Type (Simulate Keystrokes): <ALTD>h<ALTU> // This is overkill in my view! For standard Windows hotkeys like Alt+F4 and Alt+spacebar, these work nicely: Text Type (Simulate Keystrokes): <ALT><F4> // Close this window Text Type (Simulate Keystrokes): <ALT><SPACE> // Activate the System menu for this window