Jump to content
Macro Express Forums

Repeat Prompt Start


Recommended Posts

I am trying to use "Repeat Prompt Start" when I try to save I get the following error:The macro, "ProCD", contains syntax errors. Sage:

Do you want to save the macro anyway?


In the repeat start. I have it set as the following:

Number of times to repeat: 10

Number 2 start co-owner on: 1

Increment the counter by: 1


Currently I'm just trying to test my macro so I'm only running 10 at time. I have not set the variable since it is rather unfamiliar to me, totally.


Once I have it up and running. I plan on using the "Repeat Until". This will be based on my using a name as the place to stop. I'm working with an address database. I'm including a sample of the code.

Bob



Window Activate: More Information

Text Type (Simulate Keystrokes): <ALT>no

Window Activate: PROCD-Temp.txt

Delay: 350 milliseconds

Text Type (Simulate Keystrokes): <CONTROL>A<DELETE>

Clipboard Paste

Text Type (Simulate Keystrokes): <CONTROL><HOME>"<END>"<DELETE>,"<END>"

Text Type (Simulate Keystrokes): <DELETE>,"<END>"

Text Type (Simulate Keystrokes): <DELETE>,"<END>"

Text Type (Simulate Keystrokes): <DELETE><DELETE>,"<END>"

Text Type (Simulate Keystrokes): <DELETE>,"<END>"

Text Type (Simulate Keystrokes): <DELETE><DELETE>,"<END>"

Text Type (Simulate Keystrokes): <DELETE>,"<END>"

Text Type (Simulate Keystrokes): <DELETE>,"<END>"

Text Type (Simulate Keystrokes): <DELETE>,"<END>"

Text Type (Simulate Keystrokes): <DELETE>,"<END>"

Text Type (Simulate Keystrokes): <DELETE><DELETE>,"<END>"

Text Type (Simulate Keystrokes): <DELETE>,"<END>"

Text Type (Simulate Keystrokes): <DELETE>,"<END>"

Text Type (Simulate Keystrokes): <DELETE>,"<END>"

Text Type (Simulate Keystrokes): <DELETE>,"<END>"

Text Type (Simulate Keystrokes): <DELETE>,"<END>"

Text Type (Simulate Keystrokes): <DELETE>,"<END>"

Text Type (Simulate Keystrokes): <SHIFT><HOME>

Clipboard Copy

Text Type (Simulate Keystrokes): <DELETE>

Text Type (Simulate Keystrokes): <CONTROL><TAB>

Text Type (Simulate Keystrokes): <CONTROL><END>

Clipboard Paste

Repeat Prompt Start

Link to comment
Share on other sites

I found a sample macro called "Repeat Until". I cannot get it to run. Here are some of my items:
My macro name is: Copy Org ProCD Test
I want the macro to run until it sees: John Brown
This is what the macro seem to suggest.
Text Box Display: Sample Macro: % Macro Name % (My macro name is: Copy Org ProCD Test)
Repeat Until %T[1]%Equals "Macro Express Pro": John Brown
The items in bold are what I substituted.
My macro is supposed to run, repeat, until it sees the name John Brown. John Brown is first item in a line of text which includes the name, address and phone number.
Bob
See is the code:
Window Activate: More Information
Delay: 350 milliseconds
Text Type (Simulate Keystrokes): <ALT>no
Window Activate: PROCD-Temp.txt
Delay: 350 milliseconds
Text Type (Simulate Keystrokes): <CONTROL>A<DELETE>
Clipboard Paste
Text Type (Simulate Keystrokes): <CONTROL><HOME>"<END>"<DELETE>,"<END>"
Text Type (Simulate Keystrokes): <DELETE>,"<END>"
Text Type (Simulate Keystrokes): <DELETE>,"<END>"
Text Type (Simulate Keystrokes): <DELETE><DELETE>,"<END>"
Text Type (Simulate Keystrokes): <DELETE>,"<END>"
Text Type (Simulate Keystrokes): <DELETE><DELETE>,"<END>"
Text Type (Simulate Keystrokes): <DELETE>,"<END>"
Text Type (Simulate Keystrokes): <DELETE>,"<END>"
Text Type (Simulate Keystrokes): <DELETE>,"<END>"
Text Type (Simulate Keystrokes): <DELETE>,"<END>"
Text Type (Simulate Keystrokes): <DELETE>,"<END>"
Text Type (Simulate Keystrokes): <DELETE>,"<END>"
Text Type (Simulate Keystrokes): <DELETE>,"<END>"
Text Type (Simulate Keystrokes): <DELETE>,"<END>"
Text Type (Simulate Keystrokes): <DELETE>,"<END>"
Text Type (Simulate Keystrokes): <DELETE>,"<END>"
Text Type (Simulate Keystrokes): <DELETE>,"<END>"
Text Type (Simulate Keystrokes): <DELETE>,"<END>"
Text Type (Simulate Keystrokes): <DELETE>,"<END>"
Text Type (Simulate Keystrokes): <DELETE>,"<END>"
Text Type (Simulate Keystrokes): <SHIFT><HOME>
Clipboard Copy
Text Type (Simulate Keystrokes): <CONTROL><SHIFT><END>
Text Type (Simulate Keystrokes): <DELETE>
Text Type (Simulate Keystrokes): <CONTROL><TAB>
Text Type (Simulate Keystrokes): <CONTROL><END>
Text Type (Simulate Keystrokes): <ENTER>
Clipboard Paste
Text Type (Simulate Keystrokes): <CONTROL><TAB>
Variable Set From Misc: "Name of Current Macro" into %MacroName%
Variable Set String %T[1]% to ""
// --------------------------------------------------------
// Display Introduction and Instructions
// --------------------------------------------------------
Text Box Display: Sample Macro: %Copy Org ProCD Test%
// Repeat until the correct answer is entered
Repeat Until %T[1]% Equals "BROWN & BROWN CHEV"
Variable Set String %T[1]%: Prompt
On Error
Catch Error: The dialog was cancelled
Variable Set String %T[1]% to "CANCEL"
End Catch Error
End Error
On Error
Catch Error: The dialog was cancelled
Variable Set String %T[1]% to "CANCEL"
End Catch Error
End Error
// Exit the repeat loop if the CANCEL button is clicked
If Variable %T[1]% Equals "CANCEL"
Break
End If
// If the answer is not Macro Express then exit
If Variable %T[1]% Does not Equal "BROWN & BROWN CHEV"
Text Box Display: Wrong Answer
End If
End Repeat
Link to comment
Share on other sites

I made a few changes based on your suggestions.

Variable Set From Misc: "Name of Current Macro" into %Copy Org ProCD Test%

Variable Set String %T[1]% to ""

Text Box Display: Sample Macro: %Copy Org ProCD Test%

Repeat Until %T[1]% Equals "BROWN & BROWN CHEV"

Variable Set String %T[1]%: Prompt

On Error

Catch Error: The dialog was cancelled

Variable Set String %T[1]% to "CANCEL"

End Catch Error

End Error

If Variable %T[1]% Equals "CANCEL"

Break

End If

If Variable %T[1]% Does not Equal "BROWN & BROWN CHEV"

Text Box Display: Wrong Answer

End If

End Repeat


Now I can get the macro to run but not repeat. After it runs it comes up and asked me for the program name. After a bit of testing I figured it was looking for the macro name, "Copy Org ProCD Test". It's clear to me that I don't understand how the program is using "Copy Org ProCD Test" and "BROWN & BROWN CHEV". After it runs it comes up and asked me for the program name. After a bit of testing I figured it was looking for the macro name, "Copy Org ProCD Test". It's clear to me that I don't understand how the program is using "Copy Org ProCD Test" and "BROWN & BROWN CHEV HYUNDAI INC".



When the text is captured in the main database. It has the following appearance. Note: The line spacing, which is not consistent on all records.

BROWN & BROWN CHEV HYUNDAI INC

1400 LOCKE DR

BOURBONNAIS, IL 60914-9301

Phone: 815-933-2251


Listed Since: 2000

Business


County: KANKAKEE (17091)

MSA: KANKAKEE, IL (3740)

Latitude: 41.164680

Longitude: -87.849480

Precision: Geocoded to address precision


Web Address: www.browndeals.com


Years SIC Codes

15+ 551102 - AUTOMOBILE DEALERS-NEW CARS

13 753801 - AUTOMOBILE REPAIRING & SERVICE

7 556108 - MOTOR HOMES-RETAIL

5 751901 - RECREATIONAL VEHICLES-RENTING & LEASING




I then have to remove all the Line Spacing and add "," so I can import the data into a database. Saving a fraction of a 2nd, regarding looking for may be a faster text editor, will see immense amounts of time. Since I am processing 36,000 records a day, 30 days at a time. This is how the finished data will look before I import into a Table.

"JOHN A EMERSON PA","714 8TH ST","BALDWIN CITY, KS 66006-6007","Phone: 785-594-6417","Listed Since: 1998","Business","County: DOUGLAS (20045)","MSA: LAWRENCE, KS (4150)","Latitude: 38.775300","Longitude: -95.188740","Precision: Geocoded to address precision","","","Years SIC Codes","15+ 802101 - DENTISTS","",""

"JOHN A FOSCATO LAW OFFICE","120 S QUINCY ST","GREEN BAY, WI 54301-4020","Phone: 920-432-8801","Listed Since: 1992","Business","County: BROWN (55009)","MSA: GREEN BAY, WI (3080)","Latitude: 44.511300","Longitude: -88.009500","Precision: Geocoded to address precision","","Web Address: www.bankruptcyattorneygreenbay.com","","Years SIC Codes","15+ 811103 - ATTORNEYS","1 729953 - BANKRUPTCY SERVICE"

"JOHN A GENTLEMAN MORTUARIES","3402 SAMSON WAY","BELLEVUE, NE 68123-4311","Phone: 402-293-0999 Fax: 402-391-1667","Listed Since: 2005","Business","County: SARPY (31153)","MSA: OMAHA, NE-IA (5920)","Latitude: 41.139780","Longitude: -95.964600","Precision: Geocoded to address precision","","Web Address: www.johnagentleman.com","","Years SIC Codes","7 726103 - FUNERAL DIRECTORS","10 726102 - CREMATORIES"

"JOHN A FOSCATO LAW OFFICE","120 S QUINCY ST","GREEN BAY, WI 54301-4020","Phone: 920-432-8801","Listed Since: 1992","Business","County: BROWN (55009)","MSA: GREEN BAY, WI (3080)","Latitude: 44.511300","Longitude: -88.009500","Precision: Geocoded to address precision","","Web Address: www.bankruptcyattorneygreenbay.com","","Years SIC Codes","15+ 811103 - ATTORNEYS","1 729953 - BANKRUPTCY SERVICE","","","",""

"JOHN A GENTLEMAN MORTUARY","1010 N 72ND ST","OMAHA, NE 68114-3296","Phone: 402-391-1664 Fax: 402-391-1667","Listed Since: 1990","Business","County: DOUGLAS (31055)","MSA: OMAHA, NE-IA (5920)","Latitude: 41.269320","Longitude: -96.023940","Precision: Geocoded to address precision","","Web Address: www.johnagentleman.com","","Years SIC Codes","9 726105 - FUNERAL PLANS (PRE-ARRANGED)","15+ 726103 - FUNERAL DIRECTORS","13 726102 - CREMATORIES","3 999966 - FEDERAL GOVERNMENT CONTRACTORS","",""

"BROWN & BROWN CHEV HYUNDAI INC","1400 LOCKE DR","BOURBONNAIS, IL 60914-9301","Phone: 815-933-2251","Listed Since: 2000","Business","County: KANKAKEE (17091)","MSA: KANKAKEE, IL (3740)","Latitude: 41.164680","Longitude: -87.849480","Precision: Geocoded to address precision","","Web Address: www.browndeals.com","","Years SIC Codes","15+ 551102 - AUTOMOBILE DEALERS-NEW CARS","13 753801 - AUTOMOBILE REPAIRING & SERVICE","7 556108 - MOTOR HOMES-RETAIL","5 751901 - RECREATIONAL VEHICLES-RENTING & LEASING","",""



The above is sample data, not an elf order. My data would be in the proper elf order and I would like it to stop with a name. That's the way the sample seem to work. I probably would've been better to be able to tell the macro to run the next 50 or 5000 records whichever number I put in.


The macro also stops and wants a program name typed in which defeats the reason for the repeat.


Bob

Link to comment
Share on other sites

It took me a few days to get the time to recreate your macro. In the future, you might get help sooner if you post your macro in a copyable form. You can do that opening a code box in this forum by clicking on the '<>' icon above. Then you can copy your macro and paste into the code box.

 

I entered the macro code you provided into a new macro and ran it. It works correctly. When it runs %T[1]% contains the default value of BROWN & BROWN CHEV. If you click the OK button when that is displayed the repeat loop ends. Clicking Cancel halts the repeat loop but the macro continues. If, however, you type anything else, the repeat continues.

 

This assumes you changed the "On Error" behavior in the "Variable Set String: Prompt" command so the error condition "The dialog was cancelled" is set to "Handle Error".

 

you said:

 

After it runs it comes up and asked me for the program name. After a bit of testing I figured it was looking for the macro name, "Copy Org ProCD Test". It's clear to me that I don't understand how the program is using "Copy Org ProCD Test" and "BROWN & BROWN CHEV". After it runs it comes up and asked me for the program name.

I do not see anything in the macro you provided that could explain what you are seeing. Perhaps it is another portion of your macro?

 

I hope you have everything working now.

Link to comment
Share on other sites

>>In the future, you might get help sooner if you post your macro in a copyable form<<

I now understand the importance of the code blocks and will use it in the future. When I do my capture of the code I thinking I would use "Copy Command Text" and then a paste.


>>how the program is using "Copy Org ProCD Test" and "BROWN & BROWN CHEV".<<

"Copy Org ProCD Test" is the name of my macro.

"BROWN & BROWN CHEV" I want the Macro to run until it comes up to whatever name I substitute for this value "BROWN & BROWN CHEV". In other words, if my capture was a list of text that start with ABCD, etc. and I substitute "D" as a replacement for "BROWN & BROWN CHEV". The program will stop when it finds "D" as the 1st character or group of characters, in the lines of text being captured.


Bob


Example:

A bob Snow

B Tom Mix

C Gene Autry

D John Wayne

E Frank Sinatra


The macro would stop at "D". The macro would also capture all the text, including the 1st character, on each line until it got to line "D".

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...
 Share

×
×
  • Create New...