Jump to content
Macro Express Forums

Rustywinger

Members
  • Posts

    120
  • Joined

  • Last visited

Posts posted by Rustywinger

  1. So I have this macro that has been in faithful employ for 6 months with no issues:

     

    It runs a custom Access utility that retrieves data from a central Database with the following criteria passed on by ME: ID,USERNAME,DATE The data is placed into the clipboard by ME and then the Utility is launched, which retrieves the clipboard data and then completes the DB query, writing it to a file on my local drive.

     

    This worked flawlessly before, and then I upgraded to 4.0.1.1. Now the utility gives me an error "Cannot open the clipboard".

     

    I have never seen this error before! Is MEP dotting its 'i's and crossing its 't's when it comes to clipboard functions?

     

    Clipboard Empty
    Variable Set String %T[48]%: Prompt
    Variable Set From Misc:  "Username" into %T[63]%
    Variable Modify String %T[48]%: Append Text (,%T[63]%)
    Delay: 200 milliseconds
    Variable Modify String: Save %T[48]% to the clipboard
    Program Launch: "VersionCodeLU.exe" (Normal) Parameters: 
    Variable Set String set %T[48]% to the contents of C:\Documents and Settings\%T[63]%\PCSreturn.txt
    Wait for Program to Terminate: VersionCodeLU.exe

  2. Thanks for the reply, Alan

     

    I suppose if nothing else, I could set up a separate macro "widget" that contained a clipboard copy command, a loop to test the state of the clipboard data before continuing, and then nestle it within the main macro at various points requiring clipboard data. This seems just too inelegant. Perhaps someone out there knows a better way?

     

     

    (Co-worker staring quizzically at the monitor)- "Is the macro waiting for data?" "No, It's taking a break for 3 seconds" "Well, why?" "It's making a point that no matter how efficient the world has become, you should stop and smell the roses, because when you don't you might walk away having missed something really important, like the clipboard data." "oh." (continues watching screen with brow furrowed)

     

     

     

    /still remembers having the "Good, Fast, Cheap - Choose any two" hammered into his head years ago.

  3. Greetings, Gurus.

     

    I have a lot of macros that begin with copying the contents of a highlighted Excel cell to the clipboard with a ME "Clipboard Copy" command.

     

    However, there is a delay in between the execution of this windows command and the actual populating of the clipboard with the cell data, and it is wreaking havoc on a process that seemed bulletproof in 3.2.

     

    What can I do to validate that the 'clipboard copy' process is complete before moving on to the next step? I don't want to have to add a delay between every step- that's just not efficient enough for an old OCD like me and I will stay up all night worrying about the nanoseconds I've lost not doing the actual job I'm being paid to slog through.

     

     

    Thanks!

  4. I had this problem too, people using different screen resolutions and an application that dynamically positioned buttons at the bottom of the screen.

     

    The solution is pretty simple:

     

    Variable Set Integer %N11% from Screen Height

    Variable Modify Integer: %N12% = %N11% - 122

    Mouse Move Screen 35, %N12%

    Mouse Left Button Click

     

    The first line puts the screen height into N11

     

    The second function deletes from N11 what the static distance from the bottom of the screen to where the button you want to click is and puts the result into N12. (You will have to figure out what it is on your interface since it won't be 122)

     

    The third line moves the mouse to a static distance from the left hand of the screen to the vertical coordinate you just put in N12.

  5. Ah! An existential crisis! Is ME a keystroke capturer, or is it a programming language?

     

    I hereby cast my vote for adding GOTO to ME. That, and some fancier date-time-manipulation commands, would be high on my wish list.

     

    Throw my vote into the hat... GOTO and markers. Seems silly not to have these if Loop functionality is already present.

  6. Hi all!

     

    I am just playing around with shortkeys... I was wondering why I can't finish Macro 'A' with a text type command that enters the prefix key (as defined in options) for a shortkey-activated Macro, so I can just hit the following key to activate Macro 'B'.

     

    - Shortkey activation: "`6"

     

    - Macro A start

    --- TEXT TYPE "`"

    - Macro A end

     

    - User manually types "6"

     

    Doing it as above not only doesn't work, it also prevents using the shortkey activator manually after Macro 'A' runs.

     

    Any ideas?

  7. Hello, alpha macroers.

     

    Is there an if argument that can detect if a certain key is being held down (such as cntl, shift, etc) during the run of a macro? I see "wait for keypress" but no "if keypress".

     

    Basically I want to modify the course of a macro: for example if the shift key gets held down while the macro is running, then prompt the user for data, otherwise just assume the data currently in the variable is right.

     

     

    Thanks for any hints/tips/bird-dogs!

  8. How large is your macro file and how large is your cache?

     

    Hi Kevin, sorry for the late reply.

     

    Entire macro file (150 items)=421kb, cache=default (1024)

     

    I am determining the cached file's state by how it executes the updated commands on other machines. I make an edit in the editor on my machine, and the machine across the room runs the updated file via hotkey right away.

  9. The problem arises when dealing with the next scheduled starting time of your macro.

     

    Suppose the macro runs at 3pm on Monday, 4pm on Tuesday, then the machine crashes. The "run macro every 25 hours" bit is fine, but the new starting time is going to be related to when the machine was restarted, not to when the macro was last run.

     

     

    D'oh... I was missed Cory's answer which was essentially the same as mine and didn't realize the topic had changed to a 25 hour clock... :-)

  10. Maybe I'm missing something...

     

    Can't the scheduled macro just save a date-coded notation to file on the hard drive stating whether it has run already that day and then a startup macro (which would be run if the machine was shut down due to a power outage) check the notation, compare the date code in aforementioned file to see if the scheduled macro has run, and if not, run it?

     

    It seems elementary to me, but then, I'm an arrogant amateur! ;-)

  11. Changes are not necessarily recognized 10 minutes after the macro file is edited. It can be up to 10 minutes. If you save when the synchronization timer is at 9 minutes 55 seconds it will seem that the macro is updated instantaneously. But if you save a moment after the synchronization occurred, it will be another 10 minutes before the change is recognized. (Assuming the Synchronize time is set to 10 minutes.)

     

    Or maybe it is working differently than I expect.

     

    What Cory said.

     

    I make progam fixes to the master file on the fly quite often and the fixes are executed by other users just as soon as I hit CNTL-S.

  12. I just thought I would say/add a few things:

     

    1- Using a Macro file over the network rocks! I have been doing it for over a year in my office. I use variables extensively and the same macro can be doing several completely different things at the same time because the variables are saved locally on each user's machine.

     

    2- I just noted the "synchronize every 10 minutes" thing. I looked in my preferences and sure enough, it was there, and set to 10. However, When I make a change to the networked master file with my machine, the changes are available to users instantly?

     

    3- How big is the cache?

  13. Ok, I am trying Paul's suggestion of using AND.

     

    Since they (Does not contain 'A' , Does not contain 'B') are both exclusive condtions, 'AND' does in fact, work here. (Thanks Paul!) I was looking at it from an inclusive viewpoint previously.

     

     

    However, I really don't see a reason 'OR' shouldn't work? I'm definitely no computer scientist but this seems pretty elementary.

  14. Thanks for the replies, guys.

     

    1- The Multiple choice menu that A and B come from (out of a possible A,B,C,D) is single choice only. The function it performs is to detect whether an ID number entered by a user was not found in the database, and if so, gives the user a multiple choice menu asking them what they would like to do- there are two flavors of creating a new DB entry for the ID number, which are 'A' and 'B'. 'C' is to re-enter the number in case it was wrong and 'D' aborts the macro entirely, cleaning up the session afterwards. This Macro links to several other Macros and can even perform and detect a loop of itself within the Macro (if that makes sense)

     

     

    2- If I use an "AND" argument, that would mean I would have to have both "A" and "B" values in the variable, right? I want this to be either A or B.

     

     

    3- This does not always happen- maybe 50% of the time (while I have been selecting 'B' exclusively) so I wonder what are the chances that ME is becoming a little unstable after awhile?

     

    Here is the code in entireity-

     

    Thanks!!!

     

     

    REM2:><REM2:><REM2:_______________________________________________________________________><REM2:Create a Record Macro><REM2:----------------------------------------------------------------------------------------------------------------------------><REM2:><REM2:1-  Active Window Check><REM2:2- Collect Patient IDENTIFIER (Skipped if custom macro was just run)><REM2:3- Open blank record><REM2:4-  Handle %T50% IDENTIFIER Contents- Determine type (CR or HCN)><REM2:5-  Prompt clerk for action if no matches to the number><REM2:><VARSR:05><REM2:---------------------------Status Display Box---------------------------------------------------------><VSETMISC:T94:Name of Current Macro><MACRUN2:RunningDialogBox><REM2:---------------------------Status Display Box---------------------------------------------------------><REM2:><REM2:-----------------------------DIAGNOSTICS------------------------------------------------------------><MACRUN2:Diagnostics- Open screen><REM2:-----------------------------DIAGNOSTICS------------------------------------------------------------><REM2:><REM2:_______________________________________________________________________><REM2:1-  Active Window Check><REM2:----------------------------------------------------------------------------------------------------------------------------><REM2:_______________________________________________________________><REM2:Determine active screen><REM2:_______________________________________________________________><CAPCONTROL:F:3:1:000144,000060><REM2:><REM2:If a record window is open, it is closed.><REM2:If "Create Profile" has been run, this section is skipped (N26=1)><IFVAR2:2:26:2:T1><VARGETCONT:1:31><REM2:If N45=1 Close window is skipped.><IFVAR2:2:45:2:T1><IFVAR2:1:31:7:Tinformation><TBCLOSE:Running><REM2:Determine if Record has a billing number><CAPCONTROL:F:3:1:000300,000080><VARGETCONT:1:31><IFVAR2:1:31:1:T><TVAR2:31:01:A><TVAR2:33:01:UNSAVED><MENU2:2:T:31:CenterCenter:You must decide"The currently open record is: %T33%.
    
    What would you like to do?Close this %T33% record and create a new record.
    Oops, let me look at this %T33% record first.><ELSE><TVAR2:31:01:A><TVAR2:33:01:SAVED><MENU2:2:T:31:CenterCenter:You must decide"The currently open record is: %T33%.
    
    What would you like to do?Close this %T33% record and create a new record.
    Oops, let me look at this %T33% record first.><ENDIF><IFVAR2:1:31:1:TB><MRETURN><ENDIF><TEXTTYPE:<ESC>><MACRUN2:RunningDialogBox><ENDIF><ENDIF><REM2:><REM2:_______________________________________________________________><REM2:If a profile editor window is open, it is closed.><IFVAR2:2:45:2:T1><IFVAR2:1:31:7:TProfile><TBCLOSE:Running><MENU2:2:T:33:CenterCenter:You must decide"There is a Client Profile window currently open. What would you like to do?Close the profile window without saving it
    Oops, let me look at this profile first.><IFVAR2:1:33:1:TB><MRETURN><ENDIF><TEXTTYPE:<ESC>><MACRUN2:RunningDialogBox><ENDIF><ENDIF><REM2:><VARSR:05><REM2:_______________________________________________________________________><REM2:2- Collect Patient IDENTIFIER (Skipped if custom macro was just run N26)><REM2:----------------------------------------------------------------------------------------------------------------------------><IFVAR2:2:26:1:1><BREAK><ELSE><REM2:If new profile has just been created, CR prompt is skipped.><IFVAR2:1:96:2:1><TOG:1><TVAR2:50:02:FPlease enter the CR# or HCN# of the patient:FFCenter:Center><TOG:2><ENDIF><VARSR:01><ENDIF><REM2:><REM2:_______________________________________________________________________><REM2:3- Open blank record><REM2:----------------------------------------------------------------------------------------------------------------------------><REM2:><REM2:_______________________________________________________________><REM2:Determine active screen><MMS2:39,38><LCLK><REM2:_______________________________________________________________><REM2:Checks screen resolution to locate button on bottom><IVAR2:11:15:><NMVAR:02:12:1:0000011:2:0000075><REM2:_______________________________________________________________><REM2:Clicks on "Billing"><MMS2:35,12N><LCLK><REM2:_______________________________________________________________><REM2:Clicks on "Ohip Billing"><MMS2:38,170><LCLK><REM2:_______________________________________________________________><REM2:Waits for Search Provider prompt box, then cancels it><TEXTTYPE:<TAB><TAB><ENTER>><TEXTTYPE:<ENTER>><DIS:<REM2:><REM2:This is the end of the N26 skip><ENDIF><REM2:_______________________________________________________________><REM2:Clicks on "Select Patient"><MMS2:775,75><LCLK><REM2:><REM2:_______________________________________________________________________><REM2:4-  Handle %T50% IDENTIFIER Contents- Determine type (CR or HCN)><REM2:----------------------------------------------------------------------------------------------------------------------------><MACRUN2:ID detection for use in NEW RECORD><WAITWIN2:000010:000000:Search Client><REM2:><IVAR2:45:01:0><REP3:08:000001:000002:0045:0:01:3><IFVAR2:2:34:1:0><OR><IFVAR2:2:34:1:2><REM2:><REM2:_______________________________________________________________><REM2:Handle an X,M,K,C Prefix or a 7-digit ID return><IFVAR2:2:45:2:2><GETCONTROL2:06:MED2020 CLINIC.EXE:ThunderRT6FormDCSearch Client002:1ThunderRT6Frame1ThunderRT6OptionButton><CCLICK:T:06:0:T:><TEXTTYPE:<TAB>%T50%<ENTER>><ENDIF><REM2:><REM2:Repeat until a result or until NO MATCH ><REP3:08:000001:000002:0033:0:01:16777215><MSD:20><IFOTH:04:2:No Match><IVAR2:45:01:2><BREAK><ENDIF><GETPX:33:S:000430:000200><IVAR2:45:01:3><ENDREP><MACRUN2:RunningDialogBox><REM2:><ELSE><REM2:><REM2:_______________________________________________________________><REM2:Handle an HCN return><IFVAR2:2:45:2:2><GETCONTROL:06:MED2020 CLINIC.EXE:003:ThunderRT6FormDCSearch ClientThunderRT6FrameThunderRT6OptionButton HCN><CCLICK:T:06:0:T:><MMS2:291,159><LCLK><TEXTTYPE:%T50%><TEXTTYPE:<ENTER>><ENDIF><REM2:><REM2:Repeat until a result or until NO MATCH ><REP3:08:000001:000002:0033:0:01:16777215><MSD:20><IFOTH:04:2:No Match><IVAR2:45:01:2><BREAK><ENDIF><IVAR2:45:01:3><IFOTH:12:2:Search Client><BREAK><ENDIF><ENDREP><MACRUN2:RunningDialogBox><REM2:><ENDIF><REM2:><REM2:_______________________________________________________________________><REM2:5-  Prompt clerk for action if no matches to the number><REM2:----------------------------------------------------------------------------------------------------------------------------><REM2:><REM2:If no match Prompt Clerk what to do><IFVAR2:2:45:1:2><TEXTTYPE:<ENTER>><MSD:200><TVAR2:93:01:A><MENU2:2:T:93:000230000263:The ID %T50% was not found in the 2020 database. If you have the patient's demographics on the bill, choose 'A' to create a new profile, if not, choose B to go into PCS to collect the DGs before creating a profile.Create a new Profile now from sheet demograpics
    Get Demographics from PCS then create profile
    Re-Enter the number
    Exit the Macro><REM2:><REM2:If "B" selected, match Loop breaks.><IFVAR2:1:93:1:B><BREAK><ENDIF><REM2:><REM2:If "A" selected, match Loop breaks.><IFVAR2:1:93:1:A><BREAK><ENDIF><REM2:><REM2:If "D" selected, process is aborted><IFVAR2:1:93:1:D><MMS2:590,392><LCLK><TEXTTYPE:<ESC>><MRETURN><ENDIF><REM2:><REM2:If "C" selected Clerk chooses to refine number, looping back to beginning.><IFVAR2:1:93:1:C><TOG:1><TVAR2:50:02:FPlease re-enter the CR# or HCN# of the patient:TF000309:000089><TOG:2><REM2:><REM2:Re-detect new number DNA><VARSR:01><REM2:Reassigns ID to proper VAR- CR to T50, HCN to T40><TVAR2:51:01:%T50%><MACRUN2:ID detection for use in NEW RECORD><MSD:200><IFVAR2:2:34:1:0><OR><IFVAR2:2:34:1:2><MMS2:140,120><LCLK><ELSE><TVAR2:40:01:%T50%><MMS2:250,120><LCLK><ENDIF><REM2:><REM2:Enter new number><MMS2:291,159><LDCLK><TEXTTYPE:%T50%><ACTIVATE2:Search Client><GETCONTROL:06:MED2020 CLINIC.EXE:003:ThunderRT6FormDCSearch ClientThunderRT6FrameThunderRT6CommandButton&Search><CCLICK:T:06:0:T:><ENDIF><ENDIF><ENDREP><IFVAR2:1:93:8:TA><OR><IFVAR2:1:93:8:TB><IFVAR2:2:34:1:0><OR><IFVAR2:2:34:1:2><REM2:Clicks Select on Client Search window><MMS2:550,400><DIS:<TBOX4:T:1:CenterCenter000278000200:000:this did NOT just happen!!!T93=%T93%><LCLK><ENDIF><ELSE><IFVAR2:2:34:1:1><TVAR2:50:01:%T51%><ENDIF><ENDIF><REM2:><REM2:Create a new profile><IFVAR2:1:93:1:A><OR><IFVAR2:1:93:1:B><REM2:Clicks Exit on Client Search window><MMS2:600,400><DIS:<MSTOP><LCLK><MSD:100><VARSR:01><REM2:><REM2:Close empty record><MMS2:140,55><LCLK><MSD:75><MMS2:155,150><CAPCONTROL:F:3:1:000155,000150><REP3:08:000008:000001:0052:0:01:Patient Information><TEXTTYPE:<ESC>><VARGETCONT:1:52><ENDREP><REM2:><REM2:Create the new profile><IFVAR2:1:93:1:B><IVAR2:25:01:1><ACTIVATE2:Misys CPR - Kingston General Hospital PCS><MACRUN2:New PCS><ACTIVATE2:NewClinic><MSD:200><ENDIF><IFVAR2:2:26:2:1><MACRUN2:4-Move CR to new profile + Record><TVAR2:93:01:><VARSR:01><ENDIF><ENDIF><REM2:><REM2:_______________________________________________________________><REM2:Set State to New Record completed so CR reloads after save><IVAR2:95:01:1><REM2:_______________________________________________________________><REM2:Set State to check attributes><IVAR2:25:01:1><REM2:_______________________________________________________________><IFVAR2:2:25:2:1><TVAR2:90:02:FPlease enter date in following format, YYYY-MM-(DD Day optional)TF000205:000258><ENDIF><MMS2:286,177><LDCLK><TEXTTYPE:%T90%><REM2:><REM2:Argument tests to see if "4-Move CR to new profile + Record" (N96=1) has been run.><REM2:If it has been run, then Create Record has two instances running. ><REM2:This will cancel out the ending of one instance.><IFVAR2:2:96:1:1><IVAR2:96:01:0><VARSR:01><MRETURN><ELSE><IFVAR2:2:25:1:1><MACRUN2:6-Open and select Doctor><ENDIF><ENDIF>

  15. Ok, I am going nuts!

     

    If Variable %T93% does not contain "A"

    OR

    If Variable %T93% does not contain "B"

    If Variable %N34% = 0

    OR

    If Variable %N34% = 2

    // Clicks Select on Client Search window

    Mouse Move Screen 550, 400

    Text Box Display: this did NOT just happen!!!

    Mouse Left Button Click

    End If

    Else

    If Variable %N34% = 1

    Variable Set String %T50% "%T51%"

    End If

    End If

     

     

    The text box "This did NOT just happen" which I put in there to debug the code contains "T93=%T93%" and the result of that is a dialog containing "T93=B".

    Why is this weird? Because if T93 really was B, that dialog box code should not be executed. Yet, it is.

     

    I don't know what to do. It executes if it contains B and it executes if it does not contain B. (The A and B are assigned values from a 4-option multiple choice menu in which I selected B.)

    Any suggestions?

     

    Below is a portion of the code. The entire macro is over 100 lines long.

     

    <IFVAR2:1:93:8:A>
      <OR>
    <IFVAR2:1:93:8:B>
         <IFVAR2:2:34:1:0>
            <OR>
         <IFVAR2:2:34:1:2>
               <REM2:Clicks Select on Client Search window>
               <MMS2:550,400>
               <TBOX4:T:1:CenterCenter000278000200:000:this did NOT just happen!!!T93=%T93%>
               <LCLK>
          <ENDIF>
    <ELSE>
          <IFVAR2:2:34:1:1>
               <TVAR2:50:01:%T51%>
          <ENDIF>
    <ENDIF>
    

  16. Thanks!

     

    For some reason, mm won't work. ss and hh do, and when I put mm:ss together, mm does not display properly (displayed 02 when should be 49)

     

    However, putting them all together, hh:mm:ss, works just fine. I will just chop up a variable with all of them in it rather than try to figure out the program issue!

     

    Thanks!

  17. Sort of on topic- I had a dialog box open that would tell the user the name of the macro currently running (captured to variable) and an argument that would test the length of the Macro name in the variable, which would then adjust the size of the dialog box so that it would be no wider and no narrower than required to display the Macro name.

  18. Hi All!

     

    I am trying to figure out the running times of my macros- specifically, a way to capture the start time and end time- and the subsequent data manipulation, or formulas, for adding up the total time a macro was being run during the day.

     

    Is there a command in ME that allows me to capture this at least?

     

    Thanks!

×
×
  • Create New...