Jump to content
Macro Express Forums

Cartwheels

Members
  • Posts

    52
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Cartwheels's Achievements

Apprentice

Apprentice (3/14)

  • Conversation Starter Rare
  • Reacting Well Rare
  • Dedicated Rare
  • First Post Rare
  • Collaborator Rare

Recent Badges

1

Reputation

  1. You guys have some really good ideas here, I like them and it also gives me couple other ideas. One is you could number the text boxes. If you have 5 total, you could number them 1-5 then use Control-f to find the location later. You could also set a variable before the text box like the label idea and have the text box display it. It kind of combines the label/ section idea/ text box number idea. You could even use an integer and have it increase by one for each text box display.
  2. I have some macros that call other macro and depending, other macros may be called. In case of an error or in certain situations I'll have a text box display pop up. I like to have the name of the macro and the line number. That way in case of an error I can go directly to the text box display in the script editor and make adjustments. Otherwise, when your dealing with multiple macros finding that particular text box display can be difficult. I can use the variable set from the name of the current macro, but it would be nice if I could set the current line number as a variable or just display it somehow. As it is now I just manually put the line number in. If code gets added or deleted though, that line number is just a general area of where the the text display box might be. So, the question is, is there a way to display the line number in a text box display or a complex pause?
  3. A couple other notes: -"i" maps input boxes or fields - Timing can make a big difference. If the macro goes too fast the mapping can be effected ending with poor results on some slow loading menus.
  4. Here is a video on Surfingkeys. It can do a lot of things! I will most likely only use a small amount of it's capabilities. https://youtu.be/QZO80CZB9Lw?si=8Yf_lGm2Vi7MTiL7
  5. Lately, to navigate webpages I have been using surfingkeys. There is also Vimium C which is similar. It is an extension for Chrome browsers and maybe others too. The extension is for surfing the web without the mouse using mostly the keyboard. One feature is when you press "f" it marks all the links visible with a letter or letters. Then you can press that letter or letters on the keyboard and just like that you will have clicked on the link. Not only does it do links, but input fields or boxes as well. It has many other features too, which I have not used. So far for me, I like it and it seems to work pretty well with Macro Express. One con about it, the letters aren't attached to the page. You have to scroll if needed first then press "f". The amount of scroll would have to be the same each time so you end up with the same letter for the link each time. It only assigns letters to the visible links, the links further down the page aren't assigned a letter. So that would be the reason to scroll down the page first . I've only been using surfingkeys for a short time, but so far I don't miss the control f and tabbing to position. It does have some drawbacks but overall not bad.
  6. Lately, to navigate webpages I have been using surfingkeys. There is also Vimium C which is similar. It is an extension for Chrome browsers and maybe others too. The extension is for surfing the web without the mouse using mostly the keyboard. One feature is when you press "f" it marks all the links visible with a letter or letters. Then you can press that letter or letters on the keyboard and just like that you will have clicked on the link. So far for me, I like it and it seems to work pretty well with Macro Express. Edit- I should have mentioned that not only does it do links but input fields or boxes as well. One con about it, the letters aren't attached to the page. You have to scroll if needed first then press "f". The amount of scroll would have to be the same each time so you end up with the same letter for the link each time. It only assigns letters to the visible links, the links further down the page aren't assigned a letter. So that would be the reason to scroll down the page first .
  7. True, most of the time using <CTRLD>f<CTRLU> and also using the tab key is going to be the best way to get your target. There are times though, I've done automation on websites (example bank websites) where they are constantly making little changes that causes the normal way to go haywire. You fix your code only to have it go haywire again a couple months later. I have not employed the above tactic anywhere yet though. Also, I have found locations on websites where using the tab key to get to target can be inconsistent and you just can't find a way that works every time. What brought me to this was that I was trying out Python/ Selenium programming. Those languages and others use elements to get to target. They do it without opening the inspection window though.
  8. I was playing around with Chrome elements and trying to get to a search box using wording in the element. The code below is what I came up with. It is a little unrefined and slow but may be a good solution in certain circumstances. You may have to tab to get the cursor on the body of the webpage to start off. The example below should put the cursor in the search box on this webpage. <WINDOW ACTIVATE Title="Navigating a webpage using Chrome and elements - Macro Express and Macro Express Pro - Macro Express Forums -" Exact_Match="FALSE" Wildcards="FALSE" _IGNORE="0x0006"/> <DELAY Flags="\x01" Time="1"/> <TEXT TYPE Action="0" Text="<CTRLD><SHIFTD>i<SHIFTU><CTRLU>" _COMMENT="Opens Inspect"/> <DELAY Flags="\x01" Time="1.5"/> <TEXT TYPE Action="0" Text="<CTRLD>f<CTRLU>"/> <DELAY Flags="\x01" Time="1"/> <TEXT TYPE Action="0" Text="elSearchField" _COMMENT="Finds element in code. The key here is finding a unique id, name or other. The lettering in blue is what the search will be looking for."/> <DELAY Flags="\x01" Time="1"/> <TEXT TYPE Action="0" Text="<TAB>" _COMMENT="To close find and highlight element"/> <TEXT TYPE Action="0" Text="<ENTER>"/> <DELAY Flags="\x01" Time="1"/> <TEXT TYPE Action="0" Text="<SHIFTD><F10><SHIFTU>" _COMMENT="Opens menu on selected element"/> <DELAY Flags="\x01" Time="1"/> <TEXT TYPE Action="0" Text="ff" _COMMENT="Selects Focus on webpage"/> <TEXT TYPE Action="0" Text="<ENTER>"/> <DELAY Flags="\x01" Time="1.2"/> <TEXT TYPE Action="0" Text="<CTRLD><SHIFTD>J<SHIFTU><CTRLU>" _COMMENT="Closes Inspect"/>
  9. I often use Go To in Excel to get to a desired range or cell, use the F5 key. Macro Express code below for that. Save it as a Snippet, it comes in handy! Then I usually do what rberq describes. <COMMENT Value="Excel F5 Go To"/> <TEXT TYPE Action="0" Text="<F5>"/> <WAIT FOR WINDOW TITLE Title="Go To" Partial="TRUE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/> <TEXT TYPE Action="0" Text="Sheet1!A1" _COMMENT="Change this to your desired range or cell"/> <TEXT TYPE Action="0" Text="<ENTER>"/> <DELAY Flags="\x01" Time=".4"/>
  10. Thanks Cory. Yes this is on point. You can imagine my surprise when I made a few minor changes to my macro including unchecking the “Wait for this macro to terminate before proceeding" box saving and assuming it would still work just fine. Two weeks later, what the heck! It's no longer working. Then it took a while to diagnose the problem because it had been working. There is no end to the learning with this stuff!
  11. Confirmed, this does work! That is excellent! It looks like the work around is to Save All The Variables in macro one and then Restore All Variables in Macro 2. At first I thought it was only working because Wait="TRUE" and once Wait is unchecked it would not work, but it does in fact work! If you plug in the second Macro Run with the Wait ="False" instead of the one Wait="TRUE", it does still work and is easy to use. <MACRO RUN Use_ID="FALSE" Name="2Testing" ID="-1" Wait="TRUE"/> <MACRO RUN Use_ID="FALSE" Name="2Testing" ID="-1" Wait="FALSE"/>
  12. If the "Wait for this macro to terminate before proceeding" is unchecked, it does seem apparent the variables cannot be passed from one macro to another using the Macro Run command. The '"Make this variable available to macros called by this macro" means nothing from my current testing. I found a thread from 2010 that came to this same conclusion as well. Basically they become they 2 stand alone macros? Is this still the case? What is the next best work around?
  13. Try the command below, you'll want a lower case x as well: <WIND>x<WINU> If that doesn't work try: Keystroke Speed: 50 milliseconds Text Type (Simulate Keystrokes): <WIND>x<WINU> Keystroke Speed: 0 milliseconds Text Box Display: test Try a different command too, like: <CTRLD>a<CTRLU> It will highlight all your desktop icons. Just don't press delete afterwards
  14. I did a little digging in the forum and found a couple of references to using Window Controls. To answer my own question, it seems like capturing the control was the answer. No matter how many ways I tried the wait for window and if window is running. It just does not work. It is mind boggling after awhile! Here is the resulting code. <COMMENT Value="Moves cusor over to command area"/> <KEYSTROKE SPEED Delay="50"/> <TEXT TYPE Action="0" Text="<ALTD><ARROW UP><ALTU>" _COMMENT="Moves cursor to the commands area under script"/> <TEXT TYPE Action="0" Text="<HOME>"/> <TEXT TYPE Action="0" Text="<ARROW DOWN><ARROW UP>" _COMMENT="Resets tree on \"All Commands\""/> <TEXT TYPE Action="0" Text="<TAB>"/> <KEYSTROKE SPEED Delay="0"/> <COMMENT Value="End -Moves cusor over to command area"/> <COMMENT Value="Text Type Keyboard section"/> <KEYSTROKE SPEED Delay="50"/> <DELAY Flags="\x01" Time="0.3"/> <TEXT TYPE Action="0" Text="k"/> <DELAY Flags="\x01" Time="0.3"/> <TEXT TYPE Action="0" Text="<ARROW RIGHT>" _COMMENT="Opens menu"/> <TEXT TYPE Action="0" Text="t"/> <TEXT TYPE Action="0" Text="<ENTER>"/> <DELAY Flags="\x01" Time="0.3"/> <WAIT FOR WINDOW TITLE Title="Text Type" Partial="FALSE" Wildcards="FALSE" Indefinite="FALSE" Hours="0" Minutes="0" Seconds="2" _IGNORE="0x0014"/> <DELAY Flags="\x01" Time="0.3"/> <CAPTURE CONTROL Option="\x01" Control="%C[1]%" UseText="FALSE"/> <DELAY Flags="\x01" Time="0.3"/> <WAIT FOR CONTROL Control="%C[1]%" Option="\x01" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/> <IF CONTROL Option="\x02" Variable="%C[1]%"/> <TEXT BOX DISPLAY Title="Testing 1" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 Yes still exists.\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="400" Height="350" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x01" Delay="1" _COMMENT=" ***Testing"/> <DELAY Flags="\x01" Time="1"/> <ELSE/> <TEXT BOX DISPLAY Title="Testing 1" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 No longer exists.\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="400" Height="350" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x01" Delay="1" _COMMENT=" ***Testing"/> <DELAY Flags="\x01" Time="1"/> <END IF/> Commands Text: // Moves cusor over to command area Keystroke Speed: 50 milliseconds Text Type (Simulate Keystrokes): <ALTD><ARROW UP><ALTU> // Moves cursor to the commands area under script Text Type (Simulate Keystrokes): <HOME> Text Type (Simulate Keystrokes): <ARROW DOWN><ARROW UP> // Resets tree on "All Commands" Text Type (Simulate Keystrokes): <TAB> Keystroke Speed: 0 milliseconds // End -Moves cusor over to command area // Text Type Keyboard section Keystroke Speed: 50 milliseconds Delay: 0.3 seconds Text Type (Simulate Keystrokes): k Delay: 0.3 seconds Text Type (Simulate Keystrokes): <ARROW RIGHT> // Opens menu Text Type (Simulate Keystrokes): t Text Type (Simulate Keystrokes): <ENTER> Delay: 0.3 seconds Wait for Window Title: Text Type Delay: 0.3 seconds Capture Control from Focused Control into %C[1]% Delay: 0.3 seconds Wait for Control until %C[1]% "Does not Exist" If Control "%C[1]%" Exists Text Box Display: Testing 1 // ***Testing Delay: 1 seconds Else Text Box Display: Testing 1 // ***Testing Delay: 1 seconds End If
  15. Here is an example that opens the Text Type in Macro Express Script Editor. It seems to freeze after the Repeat Exit at the end of this example. Once the Text Type is open I would like to be able to manually open the Variables (Button) then close that window and be able to open the Misc Keys (button) then close that window and have the macro wait till the Text Type window closes. Just for simulation, you can manually close/cancel the Text Type Window. Then the macro should continue on to Repeat Exit and on to Text Box Display, but it freezes on multiple computers. Hopefully someone knows a better or different way to accomplish this. Command text version below too. Thanks! <COMMENT Value="Moves cusor over to command area"/> <KEYSTROKE SPEED Delay="50"/> <TEXT TYPE Action="0" Text="<ALTD><ARROW UP><ALTU>" _COMMENT="Moves cursor to the commands area under script"/> <TEXT TYPE Action="0" Text="<HOME>"/> <TEXT TYPE Action="0" Text="<ARROW DOWN><ARROW UP>" _COMMENT="Resets tree on \"All Commands\""/> <TEXT TYPE Action="0" Text="<TAB>"/> <KEYSTROKE SPEED Delay="0"/> <COMMENT Value="End -Moves cusor over to command area"/> <COMMENT Value="Text Type Keyboard section"/> <KEYSTROKE SPEED Delay="50"/> <DELAY Flags="\x01" Time="0.3"/> <TEXT TYPE Action="0" Text="k"/> <DELAY Flags="\x01" Time="0.3"/> <TEXT TYPE Action="0" Text="<ARROW RIGHT>" _COMMENT="Opens menu"/> <TEXT TYPE Action="0" Text="t"/> <TEXT TYPE Action="0" Text="<ENTER>"/> <DELAY Flags="\x01" Time="0.3"/> <WAIT FOR WINDOW TITLE Title="Text Type" Partial="FALSE" Wildcards="FALSE" Indefinite="FALSE" Hours="0" Minutes="0" Seconds="2" _IGNORE="0x0014"/> <DELAY Flags="\x01" Time="0.3"/> <COMMENT Value="Problem area"/> <VARIABLE SET STRING Option="\x05" Destination="%T[1]%"/> <REPEAT START Start="1" Step="1" Count="50" Save="FALSE"/> <IF WINDOW Option="\x01" Title="%T[1]%" Partial="TRUE" Wildcards="FALSE"/> <WAIT FOR WINDOW TO LOSE FOCUS Title="%T[1]%" Partial="TRUE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/> <DELAY Flags="\x01" Time=".1"/> <VARIABLE SET STRING Option="\x05" Destination="%T[2]%"/> <WAIT FOR WINDOW TO LOSE FOCUS Title="%T[2]%" Partial="TRUE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/> <ELSE/> <REPEAT EXIT/> <END IF/> <END REPEAT/> <TEXT BOX DISPLAY Title="test 2" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 %T[1]% is no longer running.\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x01" Delay=".75"/> <DELAY Flags="\x01" Time=".75"/> // Moves cusor over to command area Keystroke Speed: 50 milliseconds Text Type (Simulate Keystrokes): <ALTD><ARROW UP><ALTU> // Moves cursor to the commands area under script Text Type (Simulate Keystrokes): <HOME> Text Type (Simulate Keystrokes): <ARROW DOWN><ARROW UP> // Resets tree on "All Commands" Text Type (Simulate Keystrokes): <TAB> Keystroke Speed: 0 milliseconds // End -Moves cusor over to command area // Text Type Keyboard section Keystroke Speed: 50 milliseconds Delay: 0.3 seconds Text Type (Simulate Keystrokes): k Delay: 0.3 seconds Text Type (Simulate Keystrokes): <ARROW RIGHT> // Opens menu Text Type (Simulate Keystrokes): t Text Type (Simulate Keystrokes): <ENTER> Delay: 0.3 seconds Wait for Window Title: Text Type Delay: 0.3 seconds // Problem area Variable Set String %T[1]% to topmost window title Repeat Start (Repeat 50 times) If Window "%T[1]%" is running Wait for Window to Lose Focus: %T[1]% Delay: .1 seconds Variable Set String %T[2]% to topmost window title Wait for Window to Lose Focus: %T[2]% Else Repeat Exit End If End Repeat Text Box Display: test 2 Delay: .75 seconds
×
×
  • Create New...