Jump to content
Macro Express Forums

adding holdings and item records


libtech

Recommended Posts

Hi,

 

I need some help with the macro that adds 48 holdings and corresponding item records for different library locations - here I included only the code for 2 locations (algo and bran) When I run the macro it updates only first few locations and then it closes the record...I tried adding delay 300 milliseconds but it didn't help. Thanks in advance

Text Type: <ALT>r

Delay 300 Milliseconds

Text Type: e

Delay 300 Milliseconds

Text Type: <TAB>

Text Type: <TAB>

Text Type: <TAB>

Text Type: <TAB>

Text Type: <TAB>

Text Type: <TAB>

Text Type: <TAB>

Text Type: <TAB>

Text Type: <F8>

Delay 300 Milliseconds

Text Type: <DELETE>

Text Type: <DELETE>

Delay 300 Milliseconds

Text Type: algo

Delay 300 Milliseconds

Text Type: <CTRL>b

Delay 300 Milliseconds

Text Type: <ENTER>

Delay 300 Milliseconds

// create algo item record

Text Type: <ALT>r

Delay 300 Milliseconds

Text Type: t

Delay 300 Milliseconds

Text Type: <CTRL>b

Delay 300 Milliseconds

Text Type: <ENTER>

Delay 300 Milliseconds

Text Type: <ALT>f

Delay 300 Milliseconds

Text Type: c

Delay 300 Milliseconds

Text Type: <ALT>f

Delay 300 Milliseconds

Text Type: c

Delay 300 Milliseconds

// create bran holding record

Text Type: <ALT>r

Delay 300 Milliseconds

Text Type: e

Delay 300 Milliseconds

Text Type: <TAB>

Text Type: <TAB>

Text Type: <TAB>

Text Type: <TAB>

Text Type: <TAB>

Text Type: <TAB>

Text Type: <TAB>

Text Type: <TAB>

Text Type: <F8>

Delay 300 Milliseconds

Text Type: <DELETE>

Text Type: <DELETE>

Delay 300 Milliseconds

Text Type: bran

Delay 300 Milliseconds

Text Type: <CTRL>b

Delay 300 Milliseconds

Text Type: <ENTER>

Delay 300 Milliseconds

// create bran item record

Text Type: <ALT>r

Delay 300 Milliseconds

Text Type: t

Delay 300 Milliseconds

Text Type: <CTRL>b

Delay 300 Milliseconds

Text Type: <ENTER>

Delay 300 Milliseconds

Text Type: <ALT>f

Delay 300 Milliseconds

Text Type: c

Delay 300 Milliseconds

Text Type: <ALT>f

Delay 300 Milliseconds

Text Type: c

Delay 300 Milliseconds

// create bruc holding record

Text Type: <ALT>r

Delay 300 Milliseconds

Text Type: e

Delay 300 Milliseconds

Text Type: <TAB>

Text Type: <TAB>

Text Type: <TAB>

Text Type: <TAB>

Text Type: <TAB>

Text Type: <TAB>

Text Type: <TAB>

Text Type: <TAB>

Text Type: <F8>

Delay 300 Milliseconds

Text Type: <DELETE>

Text Type: <DELETE>

Delay 300 Milliseconds

Text Type: bruc

Delay 300 Milliseconds

Text Type: <CTRL>b

Delay 300 Milliseconds

Text Type: <ENTER>

Delay 300 Milliseconds

Link to comment
Share on other sites

I am guessing that the typing done by the macro is getting out of sync with the screens being typed into??? So the macro keeps right on typing, but maybe the next screen is not yet ready??? Situations like that are frustrating to automate with Macro Express, because no matter how many delays you introduce, eventually Windows is busy doing something else and the application doesn't respond fast enough. Or else you have such long delays that it takes forever to run the macro.

 

If that's your problem, you could add some logic to detect when the application screen changes, and don't let the typing continue until the screen change occurs. Generally I find a spot on the current screen that will change color on the subsequent screen. Then write a repeat loop that checks pixel color at that location, and exit from the loop only when pixel color changes. Each pass through the loop should include a 100ms delay (1/10 of a second).

 

*** Done typing into first screen

***

Get Pixel Color into variable N1

Repeat 1000

Get Pixel Color into variable N2

If N1 <> N2 then exit from repeat (screen has changed)

Endif

Delay 100ms

Repeat

***

*** at this point either screen has changed, or 10 seconds (1000 repeats) have elapsed

If N1 = N2 then display text box "Error -- Time elapsed but screen did not change"

Macro Return

Endif

***

Text type into next screen

 

P.S. At beginning of your macro, set a keyboard delay of something like 30ms, so the keystrokes don't occur quite so fast.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...