Jump to content
Macro Express Forums

stevecasper

Members
  • Posts

    566
  • Joined

  • Last visited

  • Days Won

    1

stevecasper last won the day on April 7

stevecasper had the most liked content!

Contact Methods

  • Website URL
    http://
  • ICQ
    0

Profile Information

  • Gender
    Male

Recent Profile Visitors

321 profile views

stevecasper's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. Hahah, yeah, I noticed that, too. That's just how my clipboard copied it from MEP. I just highlighted the commands and used keyboard shortcuts for Copy/Paste. Alternatively, the right-click context menu offers Copy Command Text, which gives us the simplified output. I was just being lazy and using ctrl+c / ctrl+v. Text Type (Simulate Keystrokes): <ALT><ENTER> // Properties for desktop icon Delay: 500 milliseconds Text Box Display: Confirm Alt Enter Worked Text Type (Simulate Keystrokes): <ALT>c // Change icon... Delay: 500 milliseconds Text Box Display: Confirm Alt C Worked Text Type (Simulate Keystrokes): <ALT>s // Select an icon from the list below Delay: 500 milliseconds Text Box Display: Confirm Alt S Worked Text Type (Simulate Keystrokes): <HOME> // Select the icon in the top left Delay: 500 milliseconds Text Box Display: Confirm HOME Worked Text Type (Simulate Keystrokes): <ENTER> // OK Delay: 500 milliseconds Text Type (Simulate Keystrokes): <ENTER> // OK
  2. "Macro Stop" stops the macro. There's no way to continue beyond that command. That's why acantor suggested adding Macro Stop, testing, and then moving that command down to to the next command, testing, etc. However, I see from your screenshot exactly what's wrong. Your 1st command was copied into your macro from acantor's cleartext explanation of what his macro does. The actual first command for the macro is Step 3 of your macro. I would recommend deleting what you have for commands 1 and 2. I personally don't use Macro Stop for troubleshooting line by line. Instead, I use Text Box Display commands personalized for which line I'm on. I may add specific values/variables into the text box to make sure everything is the way it's supposed to be. And this way, usually, I can just continue on to the next step without having to modify the macro every step of the way. I've just confirmed that Ctrl+1 does not affect this macro at all. <TEXT TYPE Action="0" Text="<ALT><ENTER>" _COMMENT="Properties for desktop icon"/> <DELAY Flags="\x02" Time="500"/> <TEXT BOX DISPLAY Title="Confirm Alt Enter Worked" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <TEXT TYPE Action="0" Text="<ALT>c" _COMMENT="Change icon..."/> <DELAY Flags="\x02" Time="500"/> <TEXT BOX DISPLAY Title="Confirm Alt C Worked" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <TEXT TYPE Action="0" Text="<ALT>s" _COMMENT="Select an icon from the list below"/> <DELAY Flags="\x02" Time="500"/> <TEXT BOX DISPLAY Title="Confirm Alt S Worked" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <TEXT TYPE Action="0" Text="<HOME>" _COMMENT="Select the icon in the top left"/> <DELAY Flags="\x02" Time="500"/> <TEXT BOX DISPLAY Title="Confirm HOME Worked" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <TEXT TYPE Action="0" Text="<ENTER>" _COMMENT="OK"/> <DELAY Flags="\x02" Time="500"/> <TEXT TYPE Action="0" Text="<ENTER>" _COMMENT="OK"/>
  3. Did you control for the "Macro Stop" at the point where the Properties window opens but before the macro presses HOME? While there can be conflicts between Windows system and Macro Express hotkeys, I've never encountered them when using Ctrl+1. In fact, I've used Ctrl+1 through Ctrl+0 for decades (under Keyboard Express, then non-pro Macro Express, initially) as Copy commands for multiple clipboards and the corresponding Alt keys for the Paste function.
  4. Took your suggestion to heart: <COMMENT Value="Establish Multiple Choice Defaults (optional)"/> <VARIABLE SET STRING Option="\x00" Destination="%Selection%" Value="MEProTest Folder&1" NoEmbeddedVars="FALSE"/> <VARIABLE SET STRING Option="\x00" Destination="%Type%" Value="A" NoEmbeddedVars="FALSE"/> <VARIABLE SET STRING Option="\x00" Destination="%Title%" Value="Name This Document" NoEmbeddedVars="FALSE"/> <COMMENT Value="Choosing Where and How to save."/> <VARIABLE SET STRING Option="\x01" Destination="%Title%" Prompt="File Name" Mask="FALSE" OnTop="TRUE" Left="Center" Top="Center" Monitor="0"/> <MULTIPLE CHOICE MENU Style="\x00" Result="\x01" Dest="%Selection%" Title="Save this where?" Prompt="Choose a desitnation folder." Options="MEProTest Folder&1\r\nMEProTest Folder&2" Left="Center" Top="Center" Monitor="0" Width="443" Height="296" OnTop="TRUE" Columns="Auto"/> <MULTIPLE CHOICE MENU Style="\x00" Result="\x00" Dest="%Type%" Title="Save this as?" Prompt="Choose a file type." Options="&Word Document\r\n&PDF\r\nPlain &Text" Left="Center" Top="Center" Monitor="0" Width="443" Height="296" OnTop="TRUE" Columns="Auto"/> <VARIABLE MODIFY STRING Option="\x0F" Destination="%Selection%" ToReplace="&" ReplaceWith=" " All="FALSE" IgnoreCase="FALSE" NoEmbeddedVars="FALSE"/> <COMMENT Value="For the purpose of this macro, I've created two folders that are both in the D:\\ drive, but if the macro complexity were to scale, this next variable could be set as part of the earlier Multiple Choice menus."/> <VARIABLE SET STRING Option="\x00" Destination="%Directory%" Value="D:/%Selection%" NoEmbeddedVars="FALSE"/> <TEXT TYPE Action="0" Text="<F12>" _COMMENT="F12 is the \"Save As\" shortcut in the latest versions of Word."/> <WAIT FOR WINDOW TITLE Title="Save As" Partial="TRUE" Wildcards="FALSE" Indefinite="FALSE" Hours="0" Minutes="0" Seconds="10"/> <TEXT TYPE Action="0" Text="%Directory%\\%Title%"/> <IF VARIABLE Variable="%Type%" Condition="\x01" Value="A" IgnoreCase="FALSE"/> <TEXT TYPE Action="0" Text="<TAB>"/> <IF VARIABLE Variable="%Type%" Condition="\x00" Value="B" IgnoreCase="FALSE"/> <TEXT TYPE Action="0" Text="p"/> <TEXT TYPE Action="0" Text="<SHIFTD><TAB><SHIFTU>"/> <ELSE/> <TEXT TYPE Action="0" Text="pp"/> <TEXT TYPE Action="0" Text="<SHIFTD><TAB><SHIFTU>"/> <END IF/> <END IF/>
  5. Well, here's what I came up with. Word is kind of a nightmare to work with from a Macro standpoint. <COMMENT Value="Establish Multiple Choice Defaults (optional)"/> <VARIABLE SET STRING Option="\x00" Destination="%Selection%" Value="MEProTest Folder&1" NoEmbeddedVars="FALSE"/> <VARIABLE SET STRING Option="\x00" Destination="%Type%" Value="A" NoEmbeddedVars="FALSE"/> <COMMENT Value="Choosing Where and How to save."/> <MULTIPLE CHOICE MENU Style="\x00" Result="\x01" Dest="%Selection%" Title="Save this where?" Prompt="Choose a desitnation folder." Options="MEProTest Folder&1\r\nMEProTest Folder&2" Left="Center" Top="Center" Monitor="0" Width="443" Height="296" OnTop="TRUE" Columns="Auto"/> <MULTIPLE CHOICE MENU Style="\x00" Result="\x00" Dest="%Type%" Title="Save this as?" Prompt="Choose a file type." Options="&Word Document\r\n&PDF\r\nPlain &Text" Left="Center" Top="Center" Monitor="0" Width="443" Height="296" OnTop="TRUE" Columns="Auto"/> <VARIABLE MODIFY STRING Option="\x0F" Destination="%Selection%" ToReplace="&" ReplaceWith=" " All="FALSE" IgnoreCase="FALSE" NoEmbeddedVars="FALSE"/> <COMMENT Value="For the purpose of this macro, I've created two folders that are both in the D:\\ drive, but if the macro complexity were to scale, this next variable could be set as part of the earlier Multiple Choice menus."/> <VARIABLE SET STRING Option="\x00" Destination="%Directory%" Value="D:/%Selection%" NoEmbeddedVars="FALSE"/> <TEXT TYPE Action="0" Text="<F12>" _COMMENT="F12 is the \"Save As\" shortcut in the latest versions of Word."/> <WAIT FOR WINDOW TITLE Title="Save As" Partial="TRUE" Wildcards="FALSE" Indefinite="FALSE" Hours="0" Minutes="0" Seconds="10"/> <TEXT TYPE Action="0" Text="<ALTD>d<ALTU>" _COMMENT="Alt+D is the shortcut to the file directory"/> <TEXT TYPE Action="0" Text="%Directory%<ENTER>"/> <TEXT TYPE Action="0" Text="<ALTD>t<ALTU>" _COMMENT="Alt+t is the shortcut to the File Type menu"/> <IF VARIABLE Variable="%Type%" Condition="\x00" Value="A" IgnoreCase="FALSE" _COMMENT="Word (default type)"/> <TEXT TYPE Action="0" Text="<SHIFTD><TAB><SHIFTU>"/> <ELSE/> <IF VARIABLE Variable="%Type%" Condition="\x00" Value="B" IgnoreCase="FALSE" _COMMENT="PDF Type"/> <TEXT TYPE Action="0" Text="p"/> <TEXT TYPE Action="0" Text="<SHIFTD><TAB><SHIFTU>"/> <ELSE/> <TEXT TYPE Action="0" Text="pp" _COMMENT="Plain Text Type"/> <TEXT TYPE Action="0" Text="<SHIFTD><TAB><SHIFTU>"/> <END IF/> <END IF/> This macro could possibly utilize Controls, but I found them to be inconsistent (and possibly broken) when testing in Word. I've never had much luck with them in general, to be honest. Another approach I thought of after finishing this macro would be to use another Set Variable prompt where you'd give the file it's name, and then rather than specifying the file type with a series of If > Else commands, the file type is just appended to the file name. But this doesn't work (I tried it). FileName.pdf saves as FileName.pdf.docx
  6. Thanks, acantor I peek in from time to time when I need a quick refresher on how to do something and don't feel like going through trial and error to figure it out for myself. Especially when I know it's something that should be simple. But I so rarely have enough free time to participate anymore. Oddly enough I saw a string of posts with "challenge" in the title and that motivated me to find some time (it was Easter weekend... I made time to relax). I really wanted to find a way to incorporate ASCII or Text File Begin/End loops, but gave up on that approach right away. It's been too long since I've had to build one from scratch, and don't use them very frequently anymore in my day-to-day macros (not sure if any of my current day-to-days even use them). Since we're not playing with formatted, structured tables or whatever, I don't think they would have really been much use anyway. I don't think I'd ever used a Boolean variable in a macro before, but as I was attacking this problem, Boolean just made sense. The real struggle for me was the non-space special characters. I'd have it almost dialed in except it would either ignore (or duplicate!) any text following a special character. I'd come up with something that I was 99% sure would fix the problem... and it generally fixed the problem by ignoring the rest of the macro. I came up with some pretty complex ways to generate a text file that was identical to the original text . I may take a look at some of your earlier challenge posts just to see what's there and throw in my ideas (if I have any). From prior experience, if Cory takes a stab at a problem, he inevitably comes up with the superior solution.
  7. I haven't been on the forums in a while, but just wandered in over the weekend and saw this challenge. And put myself to work on it. This is what I came up with. I didn't look at the other posts until after I had gotten this one working, and I already see that mine is probably not as good or elegant as others already posted, and while there are some things that came out the same, I did take a slightly different path. I sure enjoyed the challenge! 😀 <COMMENT Value="Setting it All Up"/> <VARIABLE SET STRING Option="\x00" Destination="%Alphabet%" Value="abcdefghijklmnopqrstuvwxyz" NoEmbeddedVars="FALSE" _COMMENT="These are the characters we will ONLY keep if they are at the beginning of a word, or are following a special character."/> <VARIABLE SET STRING Option="\x02" Destination="%Unedited%" NoEmbeddedVars="FALSE" _COMMENT="Copy the Original Text to clipboard before Running this macro."/> <VARIABLE SET TO ASCII CHAR Value="13" Destination="%CR%"/> <VARIABLE SET TO ASCII CHAR Value="10" Destination="%LF%"/> <VARIABLE SET STRING Option="\x00" Destination="%CRLF%" Value="%CR%%LF%" NoEmbeddedVars="FALSE"/> <VARIABLE MODIFY STRING Option="\x0F" Destination="%Unedited%" ToReplace="%CR%%LF%" ReplaceWith="¬" All="TRUE" IgnoreCase="TRUE" NoEmbeddedVars="FALSE" _COMMENT="Replacing carriage returns and linefeeds with a nonsense character."/> <VARIABLE SET INTEGER Option="\x0D" Destination="%SizeOfUnedited%" Text_Variable="%Unedited%" _COMMENT="Length of the text will tell the macro when to stop."/> <VARIABLE MODIFY STRING Option="\x09" Destination="%FirstLetter%" Variable="%Unedited%" Start="1" Count="1" NoEmbeddedVars="FALSE" _COMMENT="Assuming the first character will always be kept, so not including it inside the Repeat function."/> <VARIABLE SET STRING Option="\x00" Destination="%LastLetter%" Value="%FirstLetter%" NoEmbeddedVars="FALSE"/> <COMMENT Value="//"/> <COMMENT Value="Putting the \"Kept\" characters/symbols directly into a text file rather than a variable so I can troubleshoot in 'real time' with a File Explorer with Preview enabled."/> <VARIABLE MODIFY STRING Option="\x11" Destination="%FirstLetter%" Filename="D:\\Edited Story.txt" Strip="FALSE" NoEmbeddedVars="FALSE" _COMMENT="This command creates the .txt file from scratch, even if it previously existed from prior runs."/> <VARIABLE SET BOOL Destination="%UseIt%" Command="263" Value="FALSE"/> <COMMENT Value="Start the Filter"/> <REPEAT START Start="1" Step="1" Count="%SizeOfUnedited%" Save="FALSE"/> <VARIABLE MODIFY STRING Option="\x0A" Destination="%unedited%" Start="1" Count="1" _COMMENT="Remove the most recent character from consideration."/> <VARIABLE MODIFY STRING Option="\x09" Destination="%NextLetter%" Variable="%Unedited%" Start="1" Count="1" NoEmbeddedVars="FALSE" _COMMENT="Check the next character"/> <COMMENT Value="Step 1:\r\nIf the character is in the Alphabet, %UseIt% will be False\r\n\r\nIf it is not in the Alpahbet, %UseIt% will be True and %special% will retain that character for future consideration."/> <IF VARIABLE Variable="%Alphabet%" Condition="\x07" Value="%NextLetter%" IgnoreCase="TRUE"/> <VARIABLE SET BOOL Destination="%UseIt%" Command="263" Value="TRUE"/> <VARIABLE SET STRING Option="\x00" Destination="%special%" Value="%NextLetter%" NoEmbeddedVars="FALSE"/> <ELSE _COMMENT="Step 1a)\r\nI struggled with differentiating spaces from other special characters. I may have found a way around it, but am leaving this in as an OR statement."/> <IF VARIABLE Variable="%LastLetter%" Condition="\x00" Value=" " IgnoreCase="FALSE"/> <OR/> <IF VARIABLE Variable="%LastLetter%" Condition="\x00" Value="%special%" IgnoreCase="FALSE"/> <VARIABLE SET BOOL Destination="%UseIt%" Command="263" Value="TRUE"/> <ELSE/> <VARIABLE SET BOOL Destination="%UseIt%" Command="263" Value="FALSE"/> <END IF/> <END IF/> <COMMENT Value="If our Boolean is True, we want to keep the special character only if it is NOT a carriage return. I found that while a carriage return shows up in String variable as \"\", it was not treated as \"\" when performing If Variable checks."/> <IF VARIABLE Variable="%UseIt%" Condition="\x00" Value="True" IgnoreCase="FALSE"/> <AND/> <IF VARIABLE Variable="%NextLetter%" Condition="\x01" Value="¬" IgnoreCase="FALSE"/> <VARIABLE MODIFY STRING Option="\x12" Destination="%NextLetter%" Filename="D:\\Edited Story.txt" Strip="FALSE" NoEmbeddedVars="FALSE"/> <END IF/> <IF VARIABLE Variable="%NextLetter%" Condition="\x00" Value="¬" IgnoreCase="FALSE" _COMMENT="And here we re-add the CR/LF back to the .txt file so our output can maintain its structural integrity."/> <VARIABLE MODIFY STRING Option="\x12" Destination="%CRLF%" Filename="D:\\Edited Story.txt" Strip="FALSE" NoEmbeddedVars="FALSE"/> <END IF/> <VARIABLE SET STRING Option="\x00" Destination="%LastLetter%" Value="%NextLetter%" NoEmbeddedVars="FALSE"/> <VARIABLE SET BOOL Destination="%UseIt%" Command="263" Value="FALSE"/> <END REPEAT/> <TEXT BOX DISPLAY Title="Modifications Complete" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Lucida Fax;}}\r\n{\\colortbl ;\\red128\\green0\\blue0;}\r\n\\viewkind4\\uc1\\pard\\cf1\\b\\f0\\fs44 Done!\\cf0\\b0 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>
  8. Hey everybody! I know it's been years since I've posted, and I've missed this place a lot. I changed jobs and my new employer didn't want to automate anything. Anyway, I've moved again and now I have a forward-thinking, efficiency-driven employer once again, who has allowed me install MEP on my machine. Not less than 24 hours later I started running into an issue that I'm hoping can be fixed. It's been so long since I had to build a macro from scratch that I may just be missing something obvious, but it also may be a limitation of Windows (or of my machine due to Administrative lockdowns). Here we go: I have a timekeeping program that I have to run at the end of the day. I'm not trying to automate that program, specifically, but I am trying to automate the launching of the program. Here's the process and the problem. I use a Launch command to launch the program. I use a Macro Run command to input the User ID and Password (I have a password macro that enters passwords for me so I don't have to remember all of them as they each have different security level requirments and min/max characters) I have tested to make sure that the macro is not getting stuck in the called "password" macro... it is returning successfully to the parent "launch" macro. At this point, the computer always gives a User Account Control prompt. I can't seem to find any way to eliminate that prompt, and MEP seems to completely ignore that window when I use Wait for Window, Activate Window, or even if I just put in a delay followed by a Text Type <ENTER> to move past that prompt. There are more problems after this one, such as Java prompts that the macro also appears to be ignoring, but this is the one that I need to know right up front if MEP has the ability to manipulate or not. I tried to get a screenshot of the prompt, but for whatever reason I couldn't do that, either. Any thoughts?
  9. Okay, I have found a consistently successful work-around for my problem. And I've got to be honest, I don't know how this could possibly make a difference (if it is my computer and not MEP), but it does. <READ REGISTRY VALUE Key="HKEY_CURRENT_USER\\MEPVariables\\Clipboard001" Destination="%cb%"/> <VARIABLE MODIFY STRING Option="\x10" Destination="%cb%"/> <CLIPBOARD PASTE/> I honestly believe my computer must be contributing to the problem, but I can't help but think there is something wrong with the Text Type > Use Clipboard to Paste function, since the Clipboard Paste command works just fine. Anyway, the work-around is simple, if not quite as elegant as I would like, and for now it seems I only really have to worry about it on my own PC. Thanks to everybody for looking at the issue and giving me pointers.
  10. I was wrong: I was looking at something else that is set at 300. The paste was set at 20. I've now adjusted this, increased it to 300. This definitely slowed the macro down considerably. And yet, I still ended up with: I love my computer... why can't it play nice?
  11. Thanks for the input, Cory. I had thought about that, but the destination application doesn't appear to be the issue in this case. I experience it in Notepad, Excel, IE, Chrome, etc. btw I got your email, when I get a sec I'll take a closer look at the vbscript. Thanks!
  12. ME3 does not experience this issue. It is, however, much much slower
  13. I take it back. Results are similar - if not identical - on other clipboards. I adjusted the paste macro, adding a counter to the repeat and adjusting the pasted text. <REPEAT START Start="1" Step="1" Count="100" Save="TRUE" Variable="%N[1]%"/> <READ REGISTRY VALUE Key="HKEY_CURRENT_USER\\MEPVariables\\Clipboard002" Destination="%cb%"/> <TEXT TYPE Action="1" Text="%N[1]% - %cb%\r\n"/> <END REPEAT/> Clipboard 1: Clipboard 2:
  14. Thanks Kevin. I checked this, and it was set at 300. I adjusted it by multiples of 10 as high as 30,000, with no improvement - in fact I didn't notice any change whatsoever in any of the clipboard-related macros I tried - and before you ask: Yes, I made sure that I saved my changes ) I did however discover something: Apparently I had only tried my "Clipboard 1" macro. I don't seem to be experiencing any problems with clipboards 2-10. I cannot imagine why this is, however, as I have changed the activation for clipboard 1 - originally set to Alt+1, but changed to Alt+Q - without any improvement. Also, the macro actually runs - as demonstrated with the repeat test-version. So the activation itself isn't likely the cause. The application I'm pasting into for the tests is a simple notepad.exe, though I experience it when pasting into anything (Excel, fields in browsers, text boxes like the one I'm typing in right now, etc). It's the most bizarre bug - and I really don't think it's MEP. I'm going to test it in ME3. Will report back.
×
×
  • Create New...