Jump to content
Macro Express Forums

paul

Members
  • Posts

    1,049
  • Joined

  • Last visited

Posts posted by paul

  1. I go back to the remote picture.

    I make a arrow down

    I can see the color is moving down to next object, but the mouse cursor is not moving.

    So when i then make a right click, it's the mouse cursors position and not the objects color, that the macro uses. And that is the object from last time...

     

    This is because the mouse is moving on the wrong machine!

    In order to demonstrate this, try the following:

    • open a remote desktop fullscreen session with the connection bar pinned
      write and run 2 macros on the remote machine to simply move the mouse up the screen until its top coordinate is 0

    - in the 1st macro have the left coordinate to the left of the connection bar; this works as expected

    - in the 2nd macro, have the left coordinate halfway across the screen so that towards the top of the screen, the connect bar will interfere; as soon as the mouse pointer overlaps the connect bar (which will be before the top coordinate is 0), the mouse will no longer appear to move!


    I believe this is because the connect bar belongs to the local computer, whereas the mouse is moving on the remote computer.

  2. I deal with a lot of Javascript applications with hidden buttons running on ie 6.

     

    I have been using ctl-f to find fields b4 the button and tabbing to and enter. I don't know a whole lot about JavaScript but I was wondering if it is possible to capture the javascript code and activate the functions for these buttons instead of going the ctl-f route.

     

    Any help is appreciated.

     

    If you're using Firefox, you may find an add-on called GreaseMonkey of interest.

  3. I've attached a .zip file containing 2 macros to allow you generically to "continue on error". This works only when a macro aborts with an error message.

     

    MacroLauncher uses a string value stored in the registry to determine which macros you want to run. This string needs to be in the format:

    macro1/macro2/macro3 etc.

    It doesn't matter whether the last named macro is terminated with / or not.

     

    MacroError should be disabled (MacroLauncher will enable and disable it as needed).

     

    In order for this to work properly, you need to do this first as per Kevin's suggestion in an earlier posting:

    Options / Preferences / Scheduler / Timer Interval Check Every 1 seconds

     

    I've commented MacroLauncher so that you can see how it works, which variables it uses, and where the registry keys it uses are located. Each named macro should be able to abort in only one way, otherwise my concept won't work.

    MacroLauncher.zip

  4. In W2k and XP wildcard file operations are done in reverse alphabetical order for normal characters a-z and 0-9. But special printable characters (limited to the set 32-126) act unpredictably. Can someone explain the rule to me?

    I've never heard of any rule like this! In order to test this out, I did the following:

    - created 2 new folders, D:\Test1 and D:\Test2

    - copied one 90-megabyte file 12 times into D:\Test1, called respectively

    a1, a2, b1, b2, c1, c2, z2, z1, y2, y1, x2, x1 all with an extension of .txt

    - issued the following command from a Dos prompt:

    copy D:\Test1\?1.txt D:\Test2

    As I'd expected, the files were copied in alphabetic sequence starting with a1.txt. Various other file operations using Xcopy resulted in the same sequence.

  5. If X amount of time has elapsed

    Do this

    Elapsed using what starting point?

     

    If the time is currently X

    Do this

    This example simply displays a dialog box if the current time is between 13:00:00 and 14:00:00, otherwise it does nothing.

    Date/Time: Save "hh:mm:ss" into %T1%
    If Variable %T1% >= "13:00:00"
     AND
    If Variable %T1% <= "14:00:00"
     Text Box Display:  --The time is now %T1%
    End If

    You'll find the Date/Time command under the text category!

  6. You still need a third macro, to evaluate whether the second macro worked (i.e. it either did or did not locate the tray icon).

     

    I have reworked Kevin's excellent example into generic code, as follows:

     

    I have 3 macros, called M1, M2 and M3, where M2 and M3 are scheduled to run every second and start off disabled.

     

    M1

    If File Exists "Errorlog.txt"
     Delete File or Files: "Errorlog.txt"
    End If
    
    Variable Set String %T99% "UltraEdit-32"   --(see note 1)
    Variable Save Text Variables
    Macro Enable: M2

    M2

    Log Errors
    Macro Disable: M2
    Variable Restore Text Variables
    If Variable %T99% <> ""
     Variable Set %T1% to ASCII Char of 01  --(see note 2)
     Variable Set String %T2% "<MOVETOTRAY:%T99%%T1%T:F:0:0>"
     Macro Enable: M3
     Run Macro in Variable %T2%
    End If

    M3

    Macro Disable: M3
    Clear Text Variables: All
    Variable Save Text Variables  --see note 3

    Note 1 T99 contains the partial name of some tray icon

    Note 2 For some reason, using the command Move Mouse to Tray Icon does not work with a variable, so, instead, I create this command appending the passed-in variable T99 and run it.

    Note 3 Here you should insert whatever code you need to deal with the Icon Found and Icon Not Found conditions.

    If you are going to use this logic to handle several different tray icons, then you may need a series of conditions, as in:

    Switch %T99%
     Case:UltraEdit-32
     End Case
     Case:ZoneAlarm
     End Case
     Case:Roboform
     End Case
    End Switch

  7. In the meantime there is a way to accomplish what you asked. It requires writing three macros.

     

    Kevin, I tried this idea some time ago, and again this morning.

     

    I have 3 macros, M1, M1a and M1b.

     

    M1 does this:

    - erases the error log file if it exists

    - calls M1a

    - displays a message depending on whether the error log exists or not

    - erases the error log file if it exists

    - calls M1b

    - displays a message depending on whether the error log exists or not

     

    M1a and M1b do the same thing:

    - logs errors to the error log file, and does not display error messages

    - tries to move the mouse to tray icon xyz

    - displays a message on success, and a different one on failure

     

    But this does not work for me. When M1a fails to find the tray icon, it stops (i.e. it does not return control to macro M1). What am I doing wrong?

     

    I'm using ME v3.7a build 1.

  8. The whole point of the Shutdown utility is to be able to force a shutdown (or hibernate, suspend, etc.) on a locked workstation. If, instead, it logged you back in to the locked computer, then that would be a complete bypass of the security in Windows! That isn't the purpose of Shutdown.

     

    I have found the following URL which may work for you. In any case, it's an interesting read - I certainly learnt quite a lot from it.

     

    http://www.codeproject.com/system/RemoteUnlock.asp

  9. I do this every night in order to run some database stuff that doesn't work if the workstation is locked. The effect is that, for 6 minutes, my machine is unlocked; once the database stuff has finished, my machine hibernates with full protection.

     

    1) Download the shutdown utility from this site and unzip it to, say, C:\Utilities:

    http://www.beyondlogic.org/solutions/shutdown/shutdown.htm

     

     

    2) Write a macro called, say, RebootOn, containing these commands:

     

    Variable Set String %T1% "1"

     

    Write Registry String: "AutoAdminLogon"

    (Variable T1

    Path HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoAdminLogon)

     

    Variable Set String %T2% xxx

    (xxx is your login password)

     

    Write Registry String: "DefaultPassword"

    (Variable T2

    Path HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultPassword)

     

    Program Launch: "shutdown.exe"

    (Path/Name C:\Utilities\Shutdown.exe

    Run Normal

    Parameters -s reboot -f -l 1)

     

     

    3) Schedule this macro to run at, say, 20:00

    (use the windows scheduler, e.g.

    "C:\Program Files\Macro Express3\MeProc.exe" /ARebootOn)

     

     

    4) Write a macro called, say, RebootOff, containing these commands:

     

    Read Registry String: "AutoAdminLogon"

    (Variable T1

    Path/Name HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoAdminLogon

     

    If Variable %T1% = "0"

    Macro Return

    End If

     

    Variable Set String %T1% "0"

     

    Write Registry String: "AutoAdminLogon"

    (Variable T1

    Path HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoAdminLogon)

     

    Delete Registry Value: "DefaultPassword"

    (Path HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultPassword)

     

     

    5) Schedule this macro to run at, say, 20:06

    (use the windows scheduler, e.g.

    "C:\Program Files\Macro Express3\MeProc.exe" /ARebootOff)

     

     

    Between 20:00 and 20:06 you run your macros:

    - as one or more scheduled macros

    - or as a startup macro which runs only if AutoAdminLogon = "1"

    - your final macro could run RebootOff, if you're unsure how much time your macros need to run

  10. What you ask is not really possible, although you may be able to achieve something approaching what you want by:

     

    1) Use the Log Errors command (in the Debug category)

    Set "Log Errors to File" to ON

    Untick "Use Default Log File"

    Type in the name of a non-existent file

    Tick "Do not display error messages (log only)"

     

    2) Include your command "Wait for Key Press" (BTW, you can include multiple characters by having several "Wait for Key Press" commands separated by OR, although it's rather slow)

     

    There are a few problems associated with this approach:

    - you still have to select a number of seconds to wait; during this time, ME will not be doing anything; and it is ONLY during this time that ME will recognize the key(s) typed in

    - if the desired key presses are not typed in, your macro will abort silently after the specified number of seconds have elapsed; the only indication of this will be the existence of your specified error log file; but, unless you programatically schedule a macro to run immediately after the number of seconds has elapsed (and you can schedule only to the nearest minute) how will you ever know, and how will you restart running your macro? If you did go for the scheduled macro approach, this scheduled macro would check for the existence of the error log file and take the appropriate action.

     

    This is probably not worth doing.

  11. Kevin's sugggestion is excellent. Bearing in mind Kevin's earlier comment "Remember that even a fast computer gets slow at times.", may I suggest adding a "fudge" factor to allow for this possibility. For example, if you determine that Machine X requires a minimum delay of 1 second for a particular (type of) operation, then make that delay something like 2 seconds instead. Obviously, if a delay of 60 seconds is needed, you wouldn't necessarily make that 120 seconds - perhaps 80 would do!

  12. Each morning I have a scheduled macro that runs a series of database extractions, ftp transfers and database updates. Sometimes it's not convenient to run this job at the scheduled time if I'm in the middle of something else.

    When my scheduled macro starts, it displays a dialog box and makes a sound each second for 10 seconds, showing that the job will start in n seconds (10...9...8, etc.).

    If I close this dialog box manually, the job never starts.

     

    Below in the code for this macro. The variable %N99% can be set by the calling macro to the number of seconds to display the dialog box (it defaults to 10), and the variable %T99% can be set to a job name to display (it defaults to "the job in hand"). This macro also uses the variable %N98%.

    <REM2:Timeout number of seconds><IFVAR2:2:99:1:0><IVAR2:99:01:10><ENDIF><REM2:><REM2:Display Pause dialog box for N99 seconds><IFVAR2:1:99:1:><TVAR2:99:01:the job in hand.><ENDIF><REP3:08:000001:000002:0099:0:01:0><WAV2:C:\WINDOWS\Media\Windows XP Battery Low.wav><TBOX4:T:3:001760000467000320000084:002:Pausing (closes and continues after %N99% seconds)Close this dialogue box to abort all further processing for %T99%><DELAY:1><IFOTH:04:2:Pausing (closes and continues after %N98% seconds)><TBCLOSE:Pausing (closes and continues after %N98% seconds)><ENDIF><IFOTH:12:2:Pausing (closes and continues after %N99% seconds)><CLEARVAR1:A:ALL><VARSR:01><MSTOP><ELSE><NMVAR:07:99:0:0000098:0:0000000><NMVAR:09:99:0:0000001:0:0000000><ENDIF><ENDREP><TBCLOSE:Pausing (closes and continues after %N98% seconds)>

  13. I don't follow what you're asking! Try looking at it this way:

    • ClipMate is a facility to store lists of any kind
    • The currently focused list item is, by definition, the current contents of the clipboard
    • Whenever a new item arrives in the clipboard, it also becomes a new list item in ClipMate

    So your question doesn't make any sense to me. If you want to control navigation of ClipMate's list items via a macro, you can (refer to ClipMate's hotkeys).

  14. I have scripts that are scheduled to run unattended every day (scripts to reboot the machine in various modes, scripts to extract changed data from a large database and sftp that data to an external site, scripts to read returning data and apply changes to the

    same database, etc.). All run without the kind of problem you are describing.

     

    I can only assume there may be something wrong with your macro, either within the code itself or perhaps because ME is also trying to schedule this script, or perhaps you may have misconfigured the running of the script by Windows Scheduler.

  15. Clipmate has several different modes of operation. The essential fact to grasp is that the currently focused entry is ClipMate represents the current contents of the clipboard. You can move up and down through Clipmate by pressing either of the two hotkeys reserved for this purpose (which you can configure); when you do this, you are changing the contents of the clipboard. You can also disable Clipmate (i.e. prevent it from taking any more clips while it's disabled) and reenable it by pressing the hotkey you have defined that toggles Auto-Capture (which you can also achieve in a macro by typing the key combination that represents your hotkey).

  16. My cohort Paul uses Clipmate. He swears by it I think. That being said,  I personally don't think it's more useful than Macro Express  :rolleyes:  But I have been wrong before.

    I certainly do swear by it (though, on occasion, I have also been known to swear at it!).

     

    It's a marvellous product, and in recent times has become even more integrated into my desktop. I couldn't live without it (slight exaggeration :o). Using this product, I disable all office clipboards since they are not very helpful. I don't compare it with Macro Express, since the 2 products serve entirely different needs.

     

    So, even though Joe is wrong far more often than he cares to admit :o, this is one of those rare occasions when he's not wrong :o!

  17. Here's another method:

    Have your scheduled macro check for the existence of a specific file in a specific location. Have the macro Return immediately if this specified file exists.

     

    All you then have to do is cause the specified file to exist when you don't want the macro to do anything this time around (what I do is have a file called, say, G:\Ceru\DoNotRunMeX.txt; when I don't want to run the specific task, I rename this file to G:\Ceru\DoNotRunMe.txt, which is the name of the file being checked by the macro; then I rename it including that final X when the macro is allowed to run again).

  18. And since you're likely to have to introduce such delays into more than one macro, an approach I often use is to store the delay time (e.g. 100 milliseconds) into the registry, and have each relevant macro retrieve that value. Then, if you need to change the value, you need change it only in one place.

×
×
  • Create New...