Jump to content
Macro Express Forums

terrypin

Members
  • Content Count

    2,061
  • Joined

  • Last visited

  • Days Won

    19

terrypin last won the day on July 9

terrypin had the most liked content!

Community Reputation

14 Good

1 Follower

About terrypin

  • Rank
    Master

Profile Information

  • Gender
    Male
  • Location
    East Grinstead, West Sussex, UK

Recent Profile Visitors

937 profile views
  1. Alan: Three of the four Variable Modify options work OK here with your macro, activation and scope. The exception is Date/Time, which fails to activate the macro. The opposite happens if I switch activation to focus; only Date/Time then runs the macro! I'm hoping Support might come in with some ideas?
  2. Second macro: OK First macro: with scope and activation same as yours: Fails here except for ASCII Char and ASCII Val. However I suspect a timing issue because for the other eight types I found that the macro did run on about 10-15% of attempts. That was with the command selected followed by either a mouse left d-click or keyboard Enter, in either case followed by Esc to repeatedly try again. IOW the brisk sequence of Enter, Esc would occasionally result in your macro being run. The converse applied with the two ASCII types, which would occasionally fail. First macro: with global scope and activation same as yours: Fails here except for ASCII Char and ASCII Val. But I don't think it gave even that small proportion of successes with the other eight. First macro: with global scope and activation Window Gains Focus (like my macro). All work OK (except for Bool). Terry, Wednesday 5 August 2020, 10:05 UK
  3. Are you already comfortable with writing MEP macros? Or is this your first serious attempt? As you’ve still been unable to achieve your objective after Cory’s very detailed instructions, I suggest you set Crystal Reports aside for a while and instead try to tackle the task as close as possible with Notepad. That’s an application we can access. Show us your macro, including its code, and we can then try to reproduce and/or advise you of any specific issues. You can then apply the same approach to CR. Terry
  4. This sure is throwing up some strange behaviour! My original macro, which I'm pretty sure I tested thoroughly, now fails for the following types: Decimal, Handle, ASCII Char and ASCII Value. In every case it's because the macro does not get activated. (Note again that, unlike Alan, I can only get any success with Window Gains Focus.) I tried changing the IF criterion to the width of the dialog, as the ten are unique. But that gave the same failures. I tried changing the macro activation to Window Loses Focus from Macro Express Pro - Script Editor (Name of macro) which gave a different set of failures. It seems those four culprit dialogs are Invisible to MX Pro in some way! I'm even considering using the full command list (instead of my preferred Favourites) and activating the macro by mouse clicks in the relevant area of Macro Express Pro - Script Editor (Name of macro)...
  5. This appears to work although I had some erratic behaviour. Decimal played hard to get but fiddling around with delays appears to have sorted it. Bool is very slow to display. My code is just plain stuff, slogging through the IFs and could no doubt be improved. Also I haven't figured out why I need to double click twice in the command list to get the dialog. EDIT: Activation is Window Title: Variable Set Window Gains Focus Title is a partial match (Coudn't get reliable triggering with Window Is Opened.) Whether I'll actually now use this macro is uncertain 😉 // Assumes that one of the Variable Set... dialogs has just been opened Wait for Window Title: Variable Set Variable Set String %tTitle% to topmost window title // BOOL If Variable %tTitle% Equals "Variable Set Bool" Text Type (Simulate Keystrokes): <TAB> // First a single tab Wait for Text Playback Delay: 0.1 seconds Text Type (Simulate Keystrokes): <F4> // Open drop-down Wait for Text Playback Delay: 0.1 seconds End If // CONTROL TEXT If Variable %tTitle% Equals "Variable Set Control Text" Text Type (Simulate Keystrokes): <TAB> Delay: 0.1 seconds Text Type (Simulate Keystrokes): <F4> // Opens drop-down Delay: 0.1 seconds End If // DECIMAL If Variable %tTitle% Equals "Variable Set Decimal" Text Type (Simulate Keystrokes): <TAB> Delay: 0.2 seconds Text Type (Simulate Keystrokes): <F4> // Opens drop-down Delay: 0.1 seconds End If // FROM FILE If Variable %tTitle% Equals "Variable Set From File" Text Type (Simulate Keystrokes): <TAB> Delay: 0.1 seconds Text Type (Simulate Keystrokes): <F4> Delay: 0.1 seconds End If // HANDLE If Variable %tTitle% Equals "Variable Set Handle" // Back with Shift+Tab Text Type (Simulate Keystrokes): <F4> // Open drop-down Delay: 0.1 seconds End If // INTEGER If Variable %tTitle% Equals "Variable Set Integer" Text Type (Simulate Keystrokes): <TAB> Delay: 0.1 seconds Text Type (Simulate Keystrokes): <F4> // Opens drop-down Delay: 0.1 seconds End If // STRING If Variable %tTitle% Equals "Variable Set String" Text Type (Simulate Keystrokes): <TAB><TAB><TAB><TAB><TAB> Delay: 0.1 seconds Text Type (Simulate Keystrokes): <F4> // Opens drop-down Delay: 0.1 seconds End If // ASCII CHAR If Variable %tTitle% Equals "Variable Set to ASCII Char" Text Type (Simulate Keystrokes): <TAB> Delay: 0.1 seconds End If // ASCII VALUE If Variable %tTitle% Equals "Variable Set to ASCII Value" Text Type (Simulate Keystrokes): <TAB> Delay: 0.1 seconds End If // MISC // As it's not one of the preceding nine, the dialog opened must be 'Variable Set From Misc' // No tabs needed, and no drop-down. <COMMENT Value="Assumes that one of the Variable Set... dialogs has just been opened"/> <WAIT FOR WINDOW TITLE Title="Variable Set " Partial="TRUE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/> <VARIABLE SET STRING Option="\x05" Destination="%tTitle%"/> <COMMENT/> <COMMENT Value="BOOL"/> <IF VARIABLE Variable="%tTitle%" Condition="\x00" Value="Variable Set Bool" IgnoreCase="TRUE"/> <TEXT TYPE Action="0" Text="<TAB>" _COMMENT="First a single tab"/> <WAIT FOR TEXT PLAYBACK Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/> <DELAY Flags="\x01" Time="0.1"/> <TEXT TYPE Action="0" Text="<F4>" _COMMENT="Open drop-down"/> <WAIT FOR TEXT PLAYBACK Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/> <DELAY Flags="\x01" Time="0.1"/> <END IF/> <COMMENT/> <COMMENT Value="CONTROL TEXT"/> <IF VARIABLE Variable="%tTitle%" Condition="\x00" Value="Variable Set Control Text" IgnoreCase="FALSE"/> <TEXT TYPE Action="0" Text="<TAB>"/> <DELAY Flags="\x01" Time="0.1"/> <TEXT TYPE Action="0" Text="<F4>" _COMMENT="Opens drop-down"/> <DELAY Flags="\x01" Time="0.1"/> <END IF/> <COMMENT/> <COMMENT Value="DECIMAL"/> <IF VARIABLE Variable="%tTitle%" Condition="\x00" Value="Variable Set Decimal" IgnoreCase="FALSE"/> <TEXT TYPE Action="0" Text="<TAB>"/> <DELAY Flags="\x01" Time="0.2"/> <TEXT TYPE Action="0" Text="<F4>" _COMMENT="Opens drop-down"/> <DELAY Flags="\x01" Time="0.1"/> <END IF/> <COMMENT/> <COMMENT Value="FROM FILE"/> <IF VARIABLE Variable="%tTitle%" Condition="\x00" Value="Variable Set From File" IgnoreCase="FALSE"/> <TEXT TYPE Action="0" Text="<TAB>"/> <DELAY Flags="\x01" Time="0.1"/> <TEXT TYPE Action="0" Text="<F4>"/> <DELAY Flags="\x01" Time="0.1"/> <END IF/> <COMMENT/> <COMMENT Value="HANDLE"/> <IF VARIABLE Variable="%tTitle%" Condition="\x00" Value="Variable Set Handle" IgnoreCase="FALSE"/> <COMMENT Value="Back with Shift+Tab"/> <TEXT TYPE Action="0" Text="<F4>" _COMMENT="Open drop-down"/> <DELAY Flags="\x01" Time="0.1"/> <END IF/> <COMMENT/> <COMMENT Value="INTEGER"/> <IF VARIABLE Variable="%tTitle%" Condition="\x00" Value="Variable Set Integer" IgnoreCase="FALSE"/> <TEXT TYPE Action="0" Text="<TAB>"/> <DELAY Flags="\x01" Time="0.1"/> <TEXT TYPE Action="0" Text="<F4>" _COMMENT="Opens drop-down"/> <DELAY Flags="\x01" Time="0.1"/> <END IF/> <COMMENT/> <COMMENT Value="STRING"/> <IF VARIABLE Variable="%tTitle%" Condition="\x00" Value="Variable Set String" IgnoreCase="FALSE"/> <TEXT TYPE Action="0" Text="<TAB><TAB><TAB><TAB><TAB>"/> <DELAY Flags="\x01" Time="0.1"/> <TEXT TYPE Action="0" Text="<F4>" _COMMENT="Opens drop-down"/> <DELAY Flags="\x01" Time="0.1"/> <END IF/> <COMMENT/> <COMMENT Value="ASCII CHAR"/> <IF VARIABLE Variable="%tTitle%" Condition="\x00" Value="Variable Set to ASCII Char" IgnoreCase="FALSE"/> <TEXT TYPE Action="0" Text="<TAB>"/> <DELAY Flags="\x01" Time="0.1"/> <END IF/> <COMMENT/> <COMMENT Value="ASCII VALUE"/> <IF VARIABLE Variable="%tTitle%" Condition="\x00" Value="Variable Set to ASCII Value" IgnoreCase="FALSE"/> <TEXT TYPE Action="0" Text="<TAB>"/> <DELAY Flags="\x01" Time="0.1"/> <END IF/> <COMMENT/> <COMMENT Value="MISC"/> <COMMENT Value="As it's not one of the preceding nine, the dialog opened must be 'Variable Set From Misc'"/> <COMMENT Value="No tabs needed, and no drop-down."/>
  6. Hi Hans, Can you provide more information please. When your code above is run, what application is active (Excel?) and what is currently focused or selected? What result do you expect and exactly what result do you get? Do we need a specific file in order to reproduce the issue? Terry, UK
  7. Well done! Looking forward to trying it in the morning. It will be a neat complement to Cory’s macro, which I use to tackle the reverse task of finding those macros (if any) which run a specified macro as a ‘sub macro’.
  8. Excellent posts, thanks! I’ve plainly neglected error logging for far too long and those will be a great help. But the last recommendation gets the seegar, thanks so much @rberq. Of course, embarrassingly obvious once you see it suggested! And, thanks to Cory, I already I have his brilliant macro ‘Search and report on macro text’ which will do the job nicely.
  9. Hi Alan, Yep, you’re right on the mark there. I may return to it but meanwhile so much other stuff to do. Not least drastically culling my 2,300 macros! A key obstacle to that is avoiding removal of sub macros. MX Pro has no reliable way to identify which of these gets used in ‘main’ macros.
  10. Thanks Alan, much appreciate your nice work on this. But your macro means abandoning my existing familiar one, which I'd not want to do. At present it achieves the task of adding the 'unpercented name', in the logical place, namely within each such TBD, at the time they are inserted, where the variables can be reliably entered. If I've understood correctly your approach requires searching for them later, to add the 'unpercented name' and also do the sizing work, yes? On a specific, how and when do you expect the clipboard to capture the name of each variable? As I'm having some trouble testing it, would you mind sending me whatever files make up your own test environment please. If indeed it's possible at all I'd want any sizing to be either done in an add-on to my macro, or to follow it immediately in a fresh macro. The only ideas I had were to somehow (!) use either the complex Run macro in variable command, or the registry to manage the variable data. In practice, I guess the width and height and then change it after the first run. So I'm ready to conclude that this is one of those 'nice-to-have' macros that are not really worth the effort, apart admittedly for the intellectual satisfaction! Terry
  11. Morning Alan, 1. The latter. 2. I think a fixed width of say 120 chars would be OK (including 'xxx...xxx = ', with word wrap if then necessary. Terry
  12. Hi Alan, Still yet to get to my PC (tomorrow) but reading your three posts more carefully in bed now on my iPad, with a glass of Chardonnay for inspiration. I don’t see anything that automatically changes the size of the TBD? With several variables listed, varying in width, I’m wondering if there’s some way to resize it appropriately based on the length of the longest one? Of course, it’s easy enough to do manually, but.... Terry
  13. Many thanks Alan, those look very interesting. Garden chores all day today so will try them tomorrow morning.
×
×
  • Create New...