Jump to content
Macro Express Forums

paul

Members
  • Posts

    1,049
  • Joined

  • Last visited

Posts posted by paul

  1. Anybody come up with a better work-around than mine? Please somebody say yes!

    Why not have the macro that enables your reminder also set the schedule activation?

    In other words, your enabling macro will also schedule the enabled macro just as if you were doing it yourself manually.

    So it will tab from field to field, and set the exact time when you want the macro to run (I think you only set it to run once, because, if I've understood you, the reminder macro is then disabled until it's re-enabled by its boss macro - at which point you reset the once schedule).

     

    Does that make sense?

  2. Much as I understand that MEP was not originally intended for programmers, I believe MEP is now a different, and far more powerful, creature than its ME3 predecessor.

     

    Although MEP does include the ability to handle controls, the features are sparse indeed. Indeed, one could be forgiven for being confused about the intended audience; after all, global vs. local variables, PostMessage and controls, etc. are not really intended for the audience I suspect ME3 was originally created for.

     

    If you compare the abilities of Autoit with MEP, then it's easy to see that MEP falls very short of what is possible. You have only to look at the AutoIt Info tool (which goes far beyong the equivalent Mouse Locator tool) to see just how much MEP is missing, and just how much we developers are missing out on. That's a shame because MEP's interface is mostly streets ahead of anything comparable that I've encountered.

     

    If you use the AutoIt Info tool to look at an MDI application, e.g. Microsoft Access, you'd be astonished just how many objects are being treated as controls. For example, AutoIt mostly uses control-based, instead of windows-based, commands to handle all of Access' MDI child windows. You could be forgiven for believing that almost everything out there is control-based, except, of course, for web-based objects and applications.

  3. I'm not sure that replacing your clipboard variables with registry values will do much for you. After all, you're still using Clipboard Copy - and a chain is as weak as its weakest link! IMHO, it's that Clipboard Copy command in your penultimate code block that is failing - and you're not checking that it's copied anything to the clipboard (in other words, it's the same old problem).

  4. Is it possible that the original variable %acctnumber% was defined as other than a text variable, e.g. integer? I've experienced this problem once, where a text variable I expected MEP to create for me was created as an integer. I suspect there's a command somewhere which either handles variables of more than one type, or is simply fooling MEP into creating a new variable of the wrong type.

    Of course, for this to be relevant, you need to have the following settings:

    - Prompt the user to create a variable that is not defined : Unticked

    - Automatically create variables in Script Editor : Ticked

  5. I don't know if this is of any help, but if you go to VbNet and search on the word Sort, items 1, 2, 3, 5 and 7 may be of interest (lots of VB6 code which you may be able to plough through).

     

    There are also many free sort utilities available on the web, some of which allow you to sort on particular columns. Thus you would create a file of data, sort it with one utility or another, then read back in to ME the contents of your sorted file. Writing sort routines can be quite challenging, and I'm not sure MEP is the right vehicle to accomplish this.

  6. In our PGM Library we save variables up to a maximum limit of 16 versions (akin to a stack 16 levels deep)! Thus, starting with n1=0, we can increment n1 16 times, each time saving our variables anew. On the 16th occasion, n1 will equal 16. The mere act of restoring to the previous level has the effect of decrementing n1 by 1.

    This works well, one major reason being that the variables we can save and restore are known in advance, i.e. n1-n100, t1-t100 and d1-d100.

     

    But today the sky's the limit. You can call your variables anything you like, and there are more variable types. This would make the task of rewriting the stack concept very difficult to accomplish if not impossible (unless, of course, we were to restrict such variables to a known set, e.g. n[1]-n[100], etc - this approach would impose constraints on our users which they would probably find unacceptable).

     

    I can imagine it's quite hard for MEP to keep track of all the variables it needs to save and restore. Furthermore, relying on this single-set save and restore may tend to be very restrictive because a save done by one macro at a given point in time can easily be overwritten by another save done by the same, or a different, macro at another time. Don't forget - all variable saves and restores maintain only a single set of variable values, whcih are global to all macros at all times (I'm excluding consideration of local variables here).

     

    I recommend you familiarise yourself with the registry (it is intended for precisely the sort of purpose we're discussing). If you reserve for yourself one or more keys within the HKCU section, you are unlikely to do any damage (I always think the warnings that accompany any registry edits are exaggerated and tend to put people off unnecessarily).

     

    Alternatively, you might want to consider the use of .ini files because ME has quite a useful set of commands dealing with sections within such files.

  7. 1) If you want to run a macro using MeProc.exe and pass parameters, then you must use Variables Restore in your macro.

     

    2) If you want Macro1 to call Macro2 without waiting for Macro2 to finish, then any of Macro1's variables that Macro2 wants to use must be saved in Macro1 and restored in Macro2.

     

    3) If you want to share variables beteen MacroA and MacroB without having MacroA call MacroB (waiting for it to finish), then the same considerations apply as in point 2 above.

     

    Otherwise, I cannot see any reason to use Variables Save and Restore in MEP.

  8. I can use the Variable Set String > Topmost Program Name to get the name of the EXE but it does not include the path. Any idea how we get the path too? My goal is to determine what version of Outlook is running.

    Try this macro, that contains a small short Autoit script. It prompts you for part of a currently running process name, and returns the path for the first such process it finds.

    Adapt as you see fit!

    <VARIABLE SET STRING Option="\x01" Destination="%sProcess%" Prompt="Enter part of the name of any running process\r\n(note that the path returned will be for the first process found containing your entered string)" Mask="FALSE" OnTop="FALSE" Left="Center" Top="Center" Monitor="0"/>
    <EXTERNAL SCRIPT Language="AutoIt" Dest="%sPath%" Script="If $CmdLine[0] <> 1 Then Exit\r\n$oWmi = ObjGet(\"winmgmts:\\\\.\\root\\CIMV2\")\r\n$oItems = $oWmi.ExecQuery(\"SELECT * FROM Win32_Process\")\r\nFor $oItem In $oItems\r\n  If StringInStr($oItem.Name, $CmdLine[1]) > 0 Then ExitLoop\r\nNext\r\nConsoleWrite($oItem.ExecutablePath)\r\n\r\n" Parameters="%sProcess%"/>
    <TEXT BOX DISPLAY Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang3081{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 Process \\b %sProcess%\\b0  can be found in\r\n\\par	 %sPath%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="500" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>

  9. You need to write an Access macro using RunCode to call a VBA public function which you must write. This macro can be triggered via a hotkey, e.g. Ctrl-M, by setting up an Autokeys macro.

     

    Your VBA function will do one of 2 things:

    - use the Shell command to call MeProc passing in the name of your macro

    (plus any parameters you may want to use via the Variables Restore command)

     

    - use the VBA code published here: Using PostMessage (but I haven't found a way of passing parameters using this method)

  10. In my experience, setting a clipboard delay of 0 is exactly the reason why you are getting the problem. generally, Windows clipboard operations are slow and unreliable. Setting ME to one side, I can often select some text and press Ctrl-C (I use ClipMate, so I can hear if the copy has worked). Often, I hear nothing on the first attempt; sometimes it takes me 3 or 4 goes before it "takes". If I experience that manually, what chance has ME got?

  11. Let me add a small contribution - I've reported on some of these issues before.

     

    MEP's presence (especially the latest version) causes my machine simply to stop in one of two ways:

    - the machine turns to treacle, and everything takes 20-30 seconds to achieve. Bringing up Task manager in order to terminate MEP requires that I bring up 2 copies of Task manager, and the 1st one won't appear until MEP has gone. Once MEP has been terminated, the machine comes back to life. This behaviour does not occur frequently - perhaps 3 times a day or less (and perhaps this has improved with the latest version - I'm not sure).

    - This next one is new to the latest version of MEP. Typing and mouse movement are ignored repeatedly for periods lasting no more than 10 seconds or so. For eaxmple, the first two words of this message are "Let me". I actually typed "Let me add...etc.", but everything after "Let me" simply never appeared. After waiting the required 10 seconds or so, I could then resume typing; but note my original 'add..." never appeared.

    I sometimes experience this behaviour perhaps as often as every 3-4 minutes, then not for some hours. Killing MEP prevents this problem completely.

    I am using Remote Desktop. MEP is running ONLY on the local machine. But this behaviour occurs ONLY on the remote machine, even though MEP is not running there.

    This behaviour occurs across a multiplicity of applications - UltraEdit, SQL Server, Firefox.

  12. Any recommendations on a reliable, objective test please?

    Well, for the slowdowns I experience, no test is needed - it's so obvious! But try bringing up the Task Manager. I do a ctrl-alt-delete and select Task Manager. Then I wait....; finally that solid green icon appears in the tray, but no Task Manager. So I do aother ctrl-alt-delete, again selecting Task Manager. After another 20 seconds have elapsed, TM finally makes a belated appearance.

  13. I have been programming for more years than I care to admit.

    Me too!

    You describe the Microsoft world very well. But I wouldn't blame ME for the iniquites foisted on us by MS and its idiosyncrasies. I suppose I should be grateful that MS allows me to run Firefox at all! Perhaps they weren't clever enough to pass an electric current through my keyboard! :rolleyes:

  14. Another caveat. I use Firefox and sometimes need to do a "quick search" for some text on the page. I always wait for a Firefox page to finish loading (by checking that the X colour is no longer red) before doing my quick search (in my case by typing |xyz if I want to look for xyz). But I've found for some pages that I must wait 1800 milliseconds after the page has completely finished loading before the quick search works properly. The curious thing is that the initial "|" causes the quick search box to appear even when there's no delay, but the cursor doesn't start blinking (and therefore won't accept any input) until that 1800 milliseconds has passed. Now, sigh, if only there were a way to detect whether the text cursor is blinking or not....

  15. Yes, a global variable is available to the macro it is defined in and all macros called (via Macro Run) below it. The only exception to this is if in a called macro a local variable is defined with the same name as the global variable then that macro will use the local variable instead of the global variable.

    The other exception is that the calling macro must wait for the called macro to terminate, otherwise the concept of global variables becomes meaningless.

×
×
  • Create New...