Jump to content
Macro Express Forums

paul

Members
  • Posts

    1,049
  • Joined

  • Last visited

Posts posted by paul

  1. Fair enough. In principle I agree with you, it's just that on this particular issue I can see both sides of the argument.

     

    How much have you saved up in your collection jar <g>?

     

    Actually, much as I dislike Gates in his Microsoft roles, I now wonder if he isn't a modern-day Robin Hood? He's stolen from the rich (MS' inflated prices over the years) and now, via his foundation, donates more to his causes than has ever been donated before. I believe he actually has more chance of generating a solution to Malaria than anyone else.

  2. No, because I'm not sure it is a bug! You can argue for or against writing an empty variable to the clipboard. Just because ME3 does it one way does not necessarily mean ME4 should do it the same way, I suppose. Empty can mean "never used, does not exist" or "used, and reset to empty" or empty, which is a valid value in its own right!

     

    In another topic, a question was asked about whether an variable is the same as a null variable. In ME terms, the answer is probably Yes. But in the database world NULL can mean very many different things.

     

    Suppose a record where Phone is NULL. This could mean any of the following:

    The user:

    - doesn't have a phone

    - doesn't know if he's got a phone

    - has a phone, but doesn't know the number

    - has a phone and won't tell us the number

    - forgot to fill the field in

    There are probably more meanings. But quite often it's important to be able to distinguish between a variable never having been initialized versus being initialized to ""

  3. Paul, how can you see that it is not clearing the clipboard?

    I use Clipmate and thus can see, at all times, exactly what is now in the clipboard and what has ever been in the clipboard (which I can reaccess at will). I also included code at the end of the test macro to retrieve the contents of the clipboard and display it.

     

    Assume the contents of the clipboard are "Abc".

    In Me3, writing an empty string to the clipboard results in "Abc" disappearing from view; but note no new value has been added to the clipboard - it's merely empty.

    In Me4, nothing happens - "Abc" remains visible and retrievable.

  4. Well, today I'm getting entirely different results!!!

     

    I'm using a Repeat 100 times.

     

    I am now getting exactly the same 25 seconds as terrypin for saving an empty variable to the clipboard (whereas yesterday I was getting 0.0 seconds for 1000 repeats). ???

     

    And this technique no longer clears the clipboard (don't forget I'm using Clipmate, so that may affect this statement - I'd be interested if this is the same for others).

  5. Running 1000 times on a quad-core machine:

     

    Clipboard Empty-------ME3: 4:21-----ME4: 2:49

    Save "" to Clipboard---ME3: 0:00-----ME4: 0:00 (why are multiple spaces reduced to a to a single space - makes indenting very hard?)

     

    The only probably difference between your environment and mine is that I am running Clipmate. However, the results of my macros remain pretty well constant, irrespective of whether Clipmate is enabled, disabled or unloaded!

  6. In other words <g>!

     

    We've gone from a simple single-process macro environment to a complex multiple-process macro environment, i.e. the sort of environment that professional software writers are well-accustomed to. So we now need to design and write our macros in a more structured (professional?) way than before.

     

    But, surely, that's not a cause for complaint, is it? If we don't want to, or cannot, learn to write our macros in a more structured way, then simply stick to what we already know and continue to run our macros one at a time. But if we dare to venture outside of our playpen, then perhaps we can make exciting discoveries on the way. It all depends on where you're coming from and on where you want to get to. It's invalid to complain about, say, the English language when faced with a decent dictionary; I don't need to know every word in order to be able to speak and write English; but if I do take the time to learn more words, then I may become more articulate, and express more complex ideas than before. But no-one is forcing me.

     

    ME4 offers far more complex features than ME3. Complex features need to be learned. That's inescapable. There's no magic bullet.

  7. Does setting a string variable from a prompt work for anyone in ME4? Using multiple monitors, I get 2 different types of error, depending on which monitor I want the prompt to appear on. I've already reported this as a bug (which, in turn, raised another bug; I used Support topic in Help to report the problem, which then generated a scripting error message - also reported, directly by email, to Kevin).

  8. Sorry to come so late to the party, but I've been away in Europe and USA!

     

    I wrote a macro some time ago that produces 2 reports, a CalledBy and a Uses report. The first lists, for each macro, all the macros it calls, while the second lists, for each macro, all the macros that call it. It's written for ME3 and, frankly, its approach probably doesn't permit it to be rewritten for ME4. It is essentially a macro that opens each macro in edit mode, then searches and counts all Macro Run instances. For one library it takes over 20 minutes to run!

     

    But with multiple libraries now possible, I don't think this will work well any more.

  9. The problem of a changed index for an existing control is as old as the hills! For example, I wrote a macro several years ago to expand the "Microsoft SQL Server" tree in Enterprise Manager. But it wouldn't work reliably simply because from one execution to the next I was unable to predict what index might be used. The solution described by PatrickB above looks as if it might be very useful for this kind of scenario.

  10. Now it's got me wondering, where in Windows the color gets translated from whatever the application sends, to what is displayed on the screen, and how would I do a reverse translation? Way too much work for what should be a simple process....

    It's worse than you might imagine! Change your video adapter, or even simply update your video adapter's driver, and you may well find your pixel values have changed! In the days before ME had a "Move mouse to tray icon" command, I even found that the icon sizes and locations would change with a new version of the video driver.

  11. It sounds like checking pixel colours is the way to go. It's very quick for a limited number of pixels (I can easily check a 40x50 rectangle of pixels without noticing any impact on performance). But remember to build in some safety features, e.g. do your pixel checking within a repeat loop a set number of times with a delay between repeats; once the repeat has exited (if the pixels are found) or ended (if they're not found) check to see whether the search was successful.

  12. Here is a technique I use in Macro Express with Roboform to make logging in to web sites easier.

     

    Assumptions:

    - We have 2 websites we want to use, Site1 and Site2. Site1 is straight-forward, simply requiring Roboform to log in; Site2 needs additional commands (eg. we need to load a different page after logging in).

    - We have setup both sites with the necessary Roboform passcards called Site1p and Site2p

    - We want to use a ME menu to drive the choice of login

    - We are running the Roboform program RoboTaskbarIcon.exe, which places the Roboform icon in the tray

     

    Create a menu with the 2 choices of Site1 or Site2. Each choice populates a variable, say T99, with the values Site1p or Site2p, then runs a macro called Passcards.

     

    The macro Passcards:

    - moves the mouse to the Roboform icon

    - right clicks

    - types l - this logs us out of Roboform

    - runs Passcards.exe passing the variable T99 which contains either Site1p or Site2p

     

    The first thing Passcards.exe will do is popup a form asking for the master password (because we just logged out of Roboform). We have a macro called Roboform which is fired whenever this popup form appears (the title will contain "Roboform Master password").

     

    The macro Roboform:

    - types in the master password (remember to secure this macro with a design-time password)

    - contains the logic needed for each passcard which has special requirements (Site2p in our example) using a Switch command on T99; it contains no logic for Site1p because none is needed

    - waits for the target window to appear before running the additional logic (Roboform will handle the login for us)

     

    The key to this lies in the Roboform macro. By logging out of Roboform, we have forced an identifiable window to appear (Enter Master Password), the appearance of which triggers our controlling macro Roboform.

     

    Thsi technique could be used in other applications where a known form can be made to appear.

  13. Take a look at Roboform; it's free for a limited number of logins.

     

    I used to use ME for logging in to password-protected sites, but it's not so easy, especially if the site doesn't always require you to login.

     

    I find Roboform indispensible, and I've incorporated it into ME in a way that is not particularly obvious! If you do decide to use Roboform, let me know if you're interested in how I use Roboform with ME.

     

    Roboform

  14. No problem.

     

    There are 2 macros, one to copy to the clipboard, and one to paste from the clipboard. The first one also pastes from the clipboard (otherwise it can't determine the success of the copy operation).

     

    1) Clipboard Copy

    This macro copies the contents of T99 to the clipboard if T99 is not blank; otherwise it copies selected text (text already selected in the active window). T98 will hold the pasted contents (so there's really no need to run the clipboard copy routine), and N99 is used for the counter.

    <REM2:[ Sub - Clipboard Copy ]><REM2:If T99 is not blank, copies its contents to the clipboard, otherwise copies selected text><REM2:Overwrites T98 and N99><REM2:><REM2:Clear clipboard - this technique is much faster than using Clipboard Empty><TVAR2:98:01:><TMVAR2:16:98:00:000:000:><REM2:><REM2:Loop through for up to 1000 milliseconds until we have a value><IVAR2:99:01:100><REP3:01:000001:000001:00010:0:01:><IFVAR2:1:99:2:><TMVAR2:16:99:00:000:000:><ELSE><CLIPC><ENDIF><TVAR2:98:03:><IFVAR2:1:98:2:><EXITREP><ENDIF><MSD:%N99%><ENDREP>

     

    2) Clipboard paste

    T99 will hold the pasted contents, and N99 is used for the counter.

    <REM2:[ Sub - Clipboard Paste ]><REM2:Overwrites T99 and N99><REM2:><REM2:Loop through for up to 1000 milliseconds until we have a value><IVAR2:99:01:100><TVAR2:99:01:><REP3:01:000001:000001:00010:0:01:><REM2:Retrieve clipboard into T99 and make sure it's not blank><TVAR2:99:03:><IFVAR2:1:99:2:><EXITREP><ENDIF><MSD:%N99%><ENDREP>

×
×
  • Create New...