Jump to content
Macro Express Forums

acantor

Members
  • Posts

    1,534
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by acantor

  1. Glad my script set you in the right direction. I imagine you'll be able to tweak the script to do what you need it to do. I've been using Macro Express for about 20 years, and I'm still finding new ways to use the program to automate tasks, simplify routine operations, and repair accessibility and usability problems.
  2. Edit: Oops, I inserted the following response in the wrong thread. My posting would have been more appropriate here: I change folders in a similar manner (although your original description seems to have vanished). The method is to type a shortkey macro into the "File Name" field of the "Save As" and "Open" dialog boxes, and in Address bars in File Explorer. I don't have a lot of paths to visit. Only three. So I have three ShortKey macros that output the full paths that I need most often, e.g., Text Type (Simulate Keystrokes): C:\Users\Alan\Documents\Pictures\2021 The nickname for this is one is "pix" and the comma is my prefix of choice. So when I type ,pix in the field, it automatically expands into the full path. I press Enter, and I've arrived. But since developing the "Save As" macro described earlier in this challenge, I have started using it more often, at least within Microsoft Word.
  3. Maybe something like this? This script seems to switch between private browsing and non-private browsing windows. Variable Set String %WinTitle% to topmost window title If Variable %WinTitle% Contains "Mozilla Firefox (Private Browsing)" Set Window Order "<Current Window>" Place on bottom // Move to the bottom of the stack of windows Window Activate: Mozilla Firefox Else Window Activate: Mozilla Firefox (Private Browsing) End If <VARIABLE SET STRING Option="\x05" Destination="%WinTitle%"/> <IF VARIABLE Variable="%WinTitle%" Condition="\x06" Value="Mozilla Firefox (Private Browsing)" IgnoreCase="FALSE"/> <SET WINDOW ORDER Window="\x00" Partial="TRUE" Wildcards="FALSE" Action="\x02" _IGNORE="0x0006" _COMMENT="Move to the bottom of the stack of windows"/> <WINDOW ACTIVATE Title="Mozilla Firefox" Exact_Match="FALSE" Wildcards="FALSE" _IGNORE="0x0006"/> <ELSE/> <WINDOW ACTIVATE Title="Mozilla Firefox (Private Browsing)" Exact_Match="FALSE" Wildcards="FALSE" _IGNORE="0x0006"/> <END IF/>
  4. Alternatively, after selecting the lines you want to copy: "Edit" menu --> "Copy Command Text". How about a window-specific macro for the Script Editor that selects the entire script and copies the command text to the clipboard? Text Type (Simulate Keystrokes): <CONTROL>a Text Type (Simulate Keystrokes): <ALT>e Text Type (Simulate Keystrokes): x
  5. Here are some instructions that may help you do what you want to do. 1. Each Macro Express macro has a nickname, including those that you have created via the Wizard. It's possible to omit the nickname when creating a macro, and they will work. But to do what you want to do, ensure both macros have nicknames. Let's assume the nickname for the first is "AAAA" and for the second, "CCCC". 2. Create a new macro. 3. Choose a new activation. For example, if your first macro is activated by Alt + A and your second macro is activated by Alt + C, choose something else for the new macro that's going to combine AAAA and CCCC. Let's choose Alt + Z for now. (You might as well assign the new macro its own nickname. Maybe "ZZZZ??") 4. In the Script Editor, find the "Macro Run" command, and insert it. Specify the nickname as AAAA. 5. Repeat, but this time, the nickname will be CCCC. The script will look something like this: Macro Run: AAAA Macro Run: CCCC 6. Save the macro. Then test it using the activation you chose in Step 3.
  6. Using ";;" as a prefix is brilliant; it's so much easier than the default, and it really should minimize conflicts. Several years ago, a company brought me in for a project, and to my surprise, Macro Express was installed on hundreds of computers. Someone had created dozens of prefix ShortKey macros. The prefix was two hashtags: ##. For example, if the macro's nickname was abc, activate it by typing "##abc". I asked several employees about their use of the macros. Not a single employee knew what I was talking about! I showed some how the macros worked, and their eyes glazed over. One employee was a one-finger typist (due to disability). She used the Windows "Sticky Keys" feature to deal with modifier keys -- Shift, Ctrl, Alt, etc. -- so the key sequence to activate this macro was this: Shift - Shift - 3 - 3 - Shift - a - b - c What this key sequence does: [Latch Sticky Keys] - [Lock Sticky Keys] - # - # - [Unlock Sticky Keys] - a - b - c Way too much physical and cognitive effort! When I work with one-handed typists (which is a common disability in my practice) and I am recommending the use of Macro Express (which I do regularly), I set the prefix for ShortKey macros to a single comma for people who use their right hand, and a single Q for people who use their left hand. I've been doing this for over 20 years, and although there are occasional conflicts, the conflicts are exceedingly rare.
  7. No problem capturing the text between "X" and "=". But for this approach to work, you must make sure that "X" and "=" only appear once in the string. The code might look something like this: Variable Set String %Data% to "Ceinture de Bloublou Niveau 160 @Donarx11 Michto : Kipu Orkou IV 999 X 12345 = 140 Il y a 15 Heure Icône" Variable Modify String: Replace " " in %Data% with "" // I don't think we need the spaces Variable Set Integer %PositionX% to the position of "X" in %Data% Variable Modify Integer: %PositionX% = %PositionX% + 2 Variable Set Integer %PositionEquals% to the position of "=" in %Data% Variable Modify Integer: %PositionEquals% = %PositionEquals% - 1 Variable Modify Integer: %CharactersToCopy% = %PositionEquals% - %PositionX% Variable Modify String: Copy part of text in %Data% starting at %PositionX% and %CharactersToCopy% characters long to %Data% Text Box Display: Result <VARIABLE SET STRING Option="\x00" Destination="%Data%" Value="Ceinture de Bloublou\r\nNiveau 160\r\n@Donarx11\r\nMichto : Kipu\r\nOrkou IV\r\n999 \r\nX\r\n12345 \r\n=\r\n140 Il y a 15 Heure\r\nIcône" NoEmbeddedVars="FALSE"/> <VARIABLE MODIFY STRING Option="\x0F" Destination="%Data%" ToReplace=" " All="TRUE" IgnoreCase="FALSE" NoEmbeddedVars="FALSE" _COMMENT="I don't think we need the spaces"/> <VARIABLE SET INTEGER Option="\x0E" Destination="%PositionX%" Text_Variable="%Data%" Text="X" Ignore_Case="FALSE"/> <VARIABLE MODIFY INTEGER Option="\x00" Destination="%PositionX%" Value1="%PositionX%" Value2="2"/> <VARIABLE SET INTEGER Option="\x0E" Destination="%PositionEquals%" Text_Variable="%Data%" Text="=" Ignore_Case="FALSE"/> <VARIABLE MODIFY INTEGER Option="\x01" Destination="%PositionEquals%" Value1="%PositionEquals%" Value2="1"/> <VARIABLE MODIFY INTEGER Option="\x01" Destination="%CharactersToCopy%" Value1="%PositionEquals%" Value2="%PositionX%"/> <VARIABLE MODIFY STRING Option="\x09" Destination="%Data%" Variable="%Data%" Start="%PositionX%" Count="%CharactersToCopy%" NoEmbeddedVars="FALSE"/> <TEXT BOX DISPLAY Title="Result" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\lang4105\\f0\\fs20 %PositionEquals% - %PositionX% = %CharactersToCopy%\r\n\\par \r\n\\par [%Data%]\\lang1033\\f1\\fs14 \r\n\\par }\r\n" Left="5" Top="417" Width="1719" Height="294" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>
  8. Yes... but you must know, or be able to calculate, the position of "hello blablabla" within the string. Does it always appear on a certain line? If yes, which line? Does "xoops" always appear before and "51616" always appear afterwards? Does the "H" in "hello blablabla" always appear as the n-th character in the string?
  9. If the organization of lines is not consistent, then this will be a very challenging project! Is there always a line that starts with the word "Niveau?" Can we always ignore the number on that line? Does the time always appear? (E.g., "Il y a 16 heures") Can we always ignore the time? If a number appears on a line by itself, can we always ignore that number?
  10. 1. I think you are saying that you want the macro to examine 15 blocks of text, and that each block is in this 11-line format: Ceinture de Bloublou Niveau 160 @DonarX11 Michto : Kipu Orkou IV 400 X 1 = 400 Il y a 15 Heure Icône 2. Can you express the number you are monitoring as a range? For example, the number you are looking for can have these values: minimum value: 100 maximum value: 999 3. Where will these blocks of text be located? In a database? In a plain text file? In a Word document? In a spreadsheet?
  11. Does "Snap" work on the Filter window? That's Windows + left arrow and/or Windows + right arrow. If yes, that might be another way to move the window to a predictable location. Although I've never tried, I imagine sending these keystrokes to the window might be very easy.
  12. Can you interact with the "Filter" window using the keyboard? If the screen is keyboard accessible, you may have a much easier time controlling the "Filter" window via Macro Express. A few specific questions: When "Filter" first opens, which control has focus? I would assume "Mode," but maybe not. Can you navigate from control to control by pressing Tab or Shift + Tab? Can you reach the buttons marked "..." by pressing Tab? When these buttons have focus, does pressing spacebar or Enter generate the list of options? Is it OK to simply type the option into a field instead of choosing it from a list? Can you cause a drop down list to open by pressing Alt + down, Alt + up, or F4?
  13. If the positions of icons shift in the "Change Icon" window, perhaps the best solution is to stop the macro after the list of icons has focus, or after the first (or last) icon is selected. Then manually select the icon you want, press Enter twice, and you're done.
  14. I also doubt that waiting for the "Change Icon" window will make a difference. The control that displays the icons is limited -- much more limited than similar controls . Only the most basic keyboard interaction rules are supported. If the icon that appears in the top-left corner varies, the script won't behave as expected. But how about the icons at the bottom of the list? Instead of pressing [Home], press [End]. Don't like that icon? Then press [Up] several times until you find one you do like. Let's say you pressed [Up] seven times. Then change this: Text Type (Simulate Keystrokes): <HOME> To this: Text Type (Simulate Keystrokes): <END><UP ARROW><UP ARROW><UP ARROW><UP ARROW><UP ARROW><UP ARROW><UP ARROW>
  15. It takes time to "fine-tune" macros like this one; and even when one puts in the time, 100% reliability is not guaranteed! To make this macro more "bullet-proof," it might help to wait for the "Properties" window to appear, and especially, for the "Change Icon" windows to appear... Perhaps something like this: Wait for Window Title: Change Icon On the other hand, if the macro in its current state works 80% of the time, I might be tempted to leave it as it is!
  16. Glad you got the macro to work! To me, the problem you posed is an excellent example of the kind of task that is amenable to automation via macros: a single action (e.g., press Ctrl+ 1) replaces a long sequence of keystrokes and/or a precise series of clicks, right-clicks, and scrolls.
  17. Different computers are configured slightly differently, so if my script isn't working, you may be the only one who can sort out how to modify it to do what you need it to do. You might find it helpful to understand how the script works. The macro assumes that one desktop shortcut is selected. (You can get to this stage by clicking a desktop shortcut once.) Then press Ctrl + 1 to start the macro. The macro opens the "Properties" screen for the selected shortcut. Then the macro does the equivalent of clicking on the "Change Icon…" button. Then, in the "Change Icon" screen, the macro navigates to the area of the window that displays all currently available icons. Then, the macro chooses the topmost icon in the display area. That's what the "Home" key does. If you want to choose a different icon, you can add different key presses, e.g., right arrow and down arrow. Then, the macro does the equivalent of clicking the "OK" button in the "Change Icon" screen. Finally, the macro does the equivalent of clicking the "OK" button in the "Properties" screen. With this explanation in mind, it's your turn to start "debugging" the script. I suggest that you insert a "Macro Stop" after the first or second step, and save the macro. Check whether the macro is bringing you closer to what you need the macro to do. If it's successful, move the "Stop" command downward a step, save the script, and try again. And so on.
  18. How about a hotkey activated macro? Select the icon you want to fix, and press whatever hotkey you want to this script: Text Type (Simulate Keystrokes): <ALT><ENTER> // Properties for desktop icon Delay: 500 milliseconds Text Type (Simulate Keystrokes): <ALT>c // Change icon... Delay: 500 milliseconds Text Type (Simulate Keystrokes): <ALT>s // Select an icon from the list below Delay: 500 milliseconds Text Type (Simulate Keystrokes): <HOME> // Select the icon in the top left Delay: 500 milliseconds Text Type (Simulate Keystrokes): <ENTER> // OK Delay: 500 milliseconds Text Type (Simulate Keystrokes): <ENTER> // OK <TEXT TYPE Action="0" Text="<ALT><ENTER>" _COMMENT="Properties for desktop icon"/> <DELAY Flags="\x02" Time="500"/> <TEXT TYPE Action="0" Text="<ALT>c" _COMMENT="Change icon..."/> <DELAY Flags="\x02" Time="500"/> <TEXT TYPE Action="0" Text="<ALT>s" _COMMENT="Select an icon from the list below"/> <DELAY Flags="\x02" Time="500"/> <TEXT TYPE Action="0" Text="<HOME>" _COMMENT="Select the icon in the top left"/> <DELAY Flags="\x02" Time="500"/> <TEXT TYPE Action="0" Text="<ENTER>" _COMMENT="OK"/> <DELAY Flags="\x02" Time="500"/> <TEXT TYPE Action="0" Text="<ENTER>" _COMMENT="OK"/>
  19. Our solutions are similar. Both of us: 1. Use Word's built in hotkey, F12, to open the "Save As" dialog box. 2. Rely on keystrokes to navigate around the "Save As" dialog box and to choose items from the drop-down list. 3. Include accelerator keys in the Multiple Choice menu to enhance keyboard access. 4. Define the folder locations as variables (for ease of maintenance, scaling up or down, etc.) There are minor differences: I do the "heavy lifting" with CASE statements instead of IF-THEN-ELSE. I opted to use the clipboard to output paths because it's faster. For PDFs, my script goes the extra step of saving the new file. The biggest difference: I use one Multiple Choice menu, and you use two: the first to get the folder, the second to get the file type. I combined the two because I always save as a Word file before I save it as a PDF or a plain text file, and I always want the second file to be in the same folder as the first. But aesthetically, I prefer what you did. Another (minor) difference: When the target folder is "Alan" I do want to save files in that folder. But I typically DON'T save files in the "CCCC" and "Stories" folders. Each folder contains multiple subfolders. So for those two folders only, my script navigates to the folder list instead of stopping in the "File Name" field. From the folder list, I can quickly reach my "real" target with a few keystrokes. I decided it was good enough to get close to my destination. The alternative would be a Multiple Choose menu displaying ten or twenty folders, which might be unwieldy. // Streamline "Save As" operations in Word 2019 // This macro automates mouse- or keyboard-intensive steps when performing a "Save As" // It includes shortcuts to save files in specific folders, and options to generate PDFs and plain text files // Restore variables from last time to produce default action for this run // (The only variable we care about is %Action%) Variable Restore: Restore Text Variables // Include full paths to the specific folders we want to shortcut. Add more if wanted Variable Set String %Path1% to "C:\tmp\Alan" Variable Set String %Path2% to "C:\tmp\CCCC" Variable Set String %Path3% to "C:\tmp\Stories" // We use the clipboard to quickly output a path; so save the original clipboard, and restore it later Variable Set String %Clip% from the clipboard contents // Offer all "Save As" options here Multiple Choice Menu: Save As... // Use Word's hotkey to invoke the "Save As" dialog box. Quit if it doesn't appear in 1 second Text Type (Simulate Keystrokes): <F12> Wait for Window Title: Save As On Error Catch Error: Condition was not met within the specified amount of time MessageBox: Problem with Macro! Macro Stop End Catch Error End Error // Do the heavy lifting, based on action chosen in multiple choice menu Switch( %Action% ) Case: Choose a &Folder... // We're done End Case Case: Save in "&Alan" Text Type (Use Clipboard and Paste Text): %Path1% // Full path to this folder Delay: 500 milliseconds // Delay needed to ensure clipboard fully outputs Text Type (Simulate Keystrokes): <ENTER> End Case Case: Save in "&CCCC" Text Type (Use Clipboard and Paste Text): %Path2% // Full path to this folder Delay: 500 milliseconds // Delay needed to ensure clipboard fully outputs Text Type (Simulate Keystrokes): <ENTER> Text Type (Simulate Keystrokes): <SHIFT><TAB><SHIFT><TAB> // Navigate to the folder list End Case Case: Save in "&Stories" Text Type (Use Clipboard and Paste Text): %Path3% // Full path to this folder Delay: 500 milliseconds // Delay needed to ensure clipboard fully outputs Text Type (Simulate Keystrokes): <ENTER> Text Type (Simulate Keystrokes): <SHIFT><TAB><SHIFT><TAB> // Navigate to the folder list End Case Case: Save as &PDF Text Type (Simulate Keystrokes): <ALT>t // Hotkey for "Save as type..." drop-down list Text Type (Simulate Keystrokes): <ARROW DOWN> // Drop-down list must be open to navigate Text Type (Simulate Keystrokes): <HOME>p // Go to top, then to first item that starts with "P" (PDF) Text Type (Simulate Keystrokes): <ENTER> Text Type (Simulate Keystrokes): <ALT>s // Hotkey for "Save" button End Case Case: Save as Plain &Text Text Type (Simulate Keystrokes): <ALT>t // Hotkey for "Save as type..." drop-down list Text Type (Simulate Keystrokes): <ARROW DOWN> // Drop-down list must be open to navigate Text Type (Simulate Keystrokes): <HOME>pp // Go to top, then to 2nd item that starts with "P" (Plain Text) Text Type (Simulate Keystrokes): <ENTER> // (Not needed when saving TXT files?) Text Type (Simulate Keystrokes): <SHIFT><TAB> // Navigate to "File name" field End Case Default Case MessageBox: Debug End Case End Switch // Try to restore original clipboard Clipboard Start Copy Text Type (Simulate Keystrokes): %Clip% Clipboard End Copy // Save variables for next time (although values won't survive a reboot) Variable Save: Save Text Variables <COMMENT Value="Streamline \"Save As\" operations in Word 2019" _BACK="0080FFFF"/> <COMMENT Value="This macro automates mouse- or keyboard-intensive steps when performing a \"Save As\"" _BACK="0080FFFF"/> <COMMENT Value="It includes shortcuts to save files in specific folders, and options to generate PDFs and plain text files" _BACK="0080FFFF"/> <COMMENT/> <COMMENT Value="Restore variables from last time to produce default action for this run" _BACK="0080FFFF"/> <COMMENT Value="(The only variable we care about is %Action%)" _BACK="0080FFFF"/> <VARIABLE RESTORE Option="\x01"/> <COMMENT/> <COMMENT Value="Include full paths to the specific folders we want to shortcut. Add more if wanted" _BACK="0080FFFF"/> <VARIABLE SET STRING Option="\x00" Destination="%Path1%" Value="C:\\tmp\\Alan" NoEmbeddedVars="FALSE"/> <VARIABLE SET STRING Option="\x00" Destination="%Path2%" Value="C:\\tmp\\CCCC" NoEmbeddedVars="FALSE"/> <VARIABLE SET STRING Option="\x00" Destination="%Path3%" Value="C:\\tmp\\Stories" NoEmbeddedVars="FALSE"/> <COMMENT/> <COMMENT Value="We use the clipboard to quickly output a path; so save the original clipboard, and restore it later" _BACK="0080FFFF"/> <VARIABLE SET STRING Option="\x02" Destination="%Clip%" NoEmbeddedVars="FALSE"/> <COMMENT/> <COMMENT Value="Offer all \"Save As\" options here" _BACK="0080FFFF"/> <MULTIPLE CHOICE MENU Style="\x00" Result="\x01" Dest="%Action%" Title="Save As..." Prompt="Where to save, or file type to save?" Options="Choose a &Folder...\r\nSave in \"&Alan\"\r\nSave in \"&CCCC\"\r\nSave in \"&Stories\"\r\nSave as &PDF\r\nSave as Plain &Text" Left="727" Top="356" Monitor="0" Width="476" Height="266" OnTop="TRUE" Columns="Auto"/> <COMMENT/> <COMMENT Value="Use Word's hotkey to invoke the \"Save As\" dialog box. Quit if it doesn't appear in 1 second" _BACK="0080FFFF"/> <TEXT TYPE Action="0" Text="<F12>"/> <COMMENT/> <WAIT FOR WINDOW TITLE Title="Save As" Partial="FALSE" Wildcards="FALSE" Indefinite="FALSE" Hours="0" Minutes="0" Seconds="1" _HANDLE="0x0014"/> <ON ERROR/> <CATCH ERROR Code="20"/> <MESSAGEBOX Caption="Problem with Macro!" Message="\"Save As\" dialog box did not appear in time" Icon="4"/> <MACRO STOP/> <END CATCH ERROR/> <END ERROR/> <COMMENT/> <COMMENT Value="Do the heavy lifting, based on action chosen in multiple choice menu" _BACK="0080FFFF"/> <SWITCH Variable="%Action%"/> <CASE Value="Choose a &Folder..."/> <COMMENT Value="We're done"/> <END CASE/> <COMMENT/> <CASE Value="Save in \"&Alan\""/> <TEXT TYPE Action="1" Text="%Path1%" _COMMENT="Full path to this folder"/> <DELAY Flags="\x02" Time="500" _COMMENT="Delay needed to ensure clipboard fully outputs"/> <TEXT TYPE Action="0" Text="<ENTER>"/> <END CASE/> <COMMENT/> <CASE Value="Save in \"&CCCC\""/> <TEXT TYPE Action="1" Text="%Path2%" _COMMENT="Full path to this folder"/> <DELAY Flags="\x02" Time="500" _COMMENT="Delay needed to ensure clipboard fully outputs"/> <TEXT TYPE Action="0" Text="<ENTER>"/> <TEXT TYPE Action="0" Text="<SHIFT><TAB><SHIFT><TAB>" _COMMENT="Navigate to the folder list"/> <END CASE/> <COMMENT/> <CASE Value="Save in \"&Stories\""/> <TEXT TYPE Action="1" Text="%Path3%" _COMMENT="Full path to this folder"/> <DELAY Flags="\x02" Time="500" _COMMENT="Delay needed to ensure clipboard fully outputs"/> <TEXT TYPE Action="0" Text="<ENTER>"/> <TEXT TYPE Action="0" Text="<SHIFT><TAB><SHIFT><TAB>" _COMMENT="Navigate to the folder list"/> <END CASE/> <COMMENT/> <CASE Value="Save as &PDF"/> <TEXT TYPE Action="0" Text="<ALT>t" _COMMENT="Hotkey for \"Save as type...\" drop-down list"/> <TEXT TYPE Action="0" Text="<ARROW DOWN>" _COMMENT="Drop-down list must be open to navigate"/> <TEXT TYPE Action="0" Text="<HOME>p" _COMMENT="Go to top, then to first item that starts with \"P\" (PDF)"/> <TEXT TYPE Action="0" Text="<ENTER>"/> <TEXT TYPE Action="0" Text="<ALT>s" _COMMENT="Hotkey for \"Save\" button "/> <END CASE/> <COMMENT/> <CASE Value="Save as Plain &Text"/> <TEXT TYPE Action="0" Text="<ALT>t" _COMMENT="Hotkey for \"Save as type...\" drop-down list"/> <TEXT TYPE Action="0" Text="<ARROW DOWN>" _COMMENT="Drop-down list must be open to navigate"/> <TEXT TYPE Action="0" Text="<HOME>pp" _COMMENT="Go to top, then to 2nd item that starts with \"P\" (Plain Text)"/> <TEXT TYPE Action="0" Text="<ENTER>" _ENABLED="FALSE" _COMMENT="(Not needed when saving TXT files?)"/> <TEXT TYPE Action="0" Text="<SHIFT><TAB>" _COMMENT="Navigate to \"File name\" field"/> <END CASE/> <COMMENT/> <DEFAULT CASE/> <MESSAGEBOX Caption="Debug" Message="Case = \"%Action%\" is not handled" Icon="1"/> <END CASE/> <END SWITCH/> <COMMENT/> <COMMENT Value="Try to restore original clipboard" _BACK="0080FFFF"/> <CLIPBOARD START COPY/> <TEXT TYPE Action="0" Text="%Clip%"/> <CLIPBOARD END COPY/> <COMMENT/> <COMMENT Value="Save variables for next time (although values won't survive a reboot)" _BACK="0080FFFF"/> <VARIABLE SAVE Option="\x01"/>
  20. Totally agree. My solution (which I will post after others have had a chance to respond) could use Windows controls. The controls in the "Save As" dialog box can be captured and acted upon. But I have found that these controls, at least in the context of this dialog box, don't improve the reliability or robustness or speed of the resulting macro. Your solution and mine overlap, and also have differences. I thought I would mention a simplification that you might find helpful: when the "Save As" dialog opens, the "File name" field has focus. Your script moves focus to the Address bar (Alt + D), outputs the destination folder, and then moves focus to "File Type" drop-down list (Alt + T). I found it's not necessary to go to the Address line. The directory can be entered directly into the "File name" field. Then press Enter, and the directory has changed!
  21. At some point, Microsoft changed the method for accessing the "Save As..." dialog box in Word. Before, accessing the "Save As…" dialog box was a two-step process: Click "File" Click "Save As..." With the keyboard, press "Alt + F" and then "A". In Word 2019, there are additional steps to access "Save As…" Click "File" Click "Save As..." [Wait for the screen to redraw] Click "Browse" Via keyboard: "Alt + F" and then "A". Then wait for "Browse" to appear. Then press "O". After cursing about Microsoft's decision to force me to perform extra steps, I realized I could use Macro Express to reduce the effort of saving documents in specific folders. For the sake of this challenge, assume that the majority of your Word documents always get saved in the same two or three folders. The challenge: 1. Develop a Macro Express script for Microsoft Word to simplify the saving of documents in specific folders. So choose two (or more) folders that you actually use! For the folders you specify, the script opens the "Save As" dialog box with that folder already selected. When the macro ends, all you need to do is type the file name (in the "File Name" field) and Save. 2. The "Save As" dialog allows you to save files in non-Word formats, e.g., PDF, Plain Text, RTF, etc. (It's done through the "Save as type" drop-down list.) Expand the capability of your macro so that it presents options to save a file as a PDF and/or a Plain Text file.
  22. Hi Steve, It's been years since you've haunted this Forum. Welcome back! I really appreciate the comments you peppered in your solution, which helped clarify your intentions. It's interesting that the approach you settled on is a hybrid between rberq's approach and mine. There really are many ways to solve this problem. For me, the "Holy Grail" to cracking this puzzle would be to use Regular Expressions. I tried, got close to a solution, but I couldn't figure it out.
  23. Yes. Get Key State "Alt" into %IsAltPressed% If Variable %IsAltPressed% Equals "True" Text Box Display: Yes Else Text Box Display: No End If
×
×
  • Create New...