Frank Posted February 22, 2023 Report Share Posted February 22, 2023 Hello, just found forum and this is first post so hopefully this is not out of place... I created a macro to fill out a form. Name, Address, phone, CC info. I open macro / code, go to 13 different lines of code and open each and input the data and save macro. the macro is now ready to use. My problem is I need to have a lot of these macros with different data for each. It is time consuming to open up a macro and change / delete old info and add new info. I would like to create a macro that opens runs, ask me for all of this data and saves the macro (with or without an activation code) in the appropriate lines of code on my original macro. I believe I need to VARIABLE SET STRINGS / Integers from prompt over and over (13 times) but not sure of what to do with those variables at the end and how to save them to a new new macro. Hope I explained well.... ANY advice or suggestions would be greatly appreciated. F Quote Link to comment Share on other sites More sharing options...
acantor Posted February 22, 2023 Report Share Posted February 22, 2023 I think you're on the right track. Maybe something like this? // (Optional) Restore the values of the variables from the previous run Variable Restore: Restore Text Variables // Collect data... Variable Set String %FirstName%: Prompt Variable Set String %LastName%: Prompt Variable Set String %PhoneNumber%: Prompt // etcetera // Output data... Text Type (Simulate Keystrokes): %FirstName% Text Type (Simulate Keystrokes): <TAB> Text Type (Simulate Keystrokes): %LastName% Text Type (Simulate Keystrokes): <TAB> Text Type (Simulate Keystrokes): %PhoneNumber% Text Type (Simulate Keystrokes): <TAB> // etcetera // (Optional) Save the values of the variables for use next time Variable Save: Save Text Variables Quote Link to comment Share on other sites More sharing options...
Frank Posted February 22, 2023 Author Report Share Posted February 22, 2023 THANK YOU for the input... Below is the macro that i run to fill in the form. This assumes that I have filled in all of the TEXT TYPE commands. If I use use the VARIABLE SET COMMANDS PROMPT The macro would ask me for the respective info and save to a variable. but then it would run the macro right away. so, I feel as if I should create a NEW MACRO that just asks for a bunch of VARIABLE SET PROMPTS but after I have gone through the prompts how do I incorporate them with my existing macro that takes the info and fills out the form? (how do I save if for a later date / use? <MACRO PLAYBACK SPEED Speed=".75"/> <COMMENT Value="CREDIT CARD TYPE\r\n V=VISA M=MasterCard A=AMEX D=Discover"/> <TEXT TYPE Action="0"/> <DELAY Flags="\x01" Time=".33"/> <TEXT TYPE Action="0" Text="<TAB>"/> <COMMENT Value="CREDIT CARD NUMBER"/> <TEXT TYPE Action="0"/> <DELAY Flags="\x01" Time=".33"/> <TEXT TYPE Action="0" Text="<TAB>"/> <COMMENT Value="MONTH EXPIRATION\r\n J=JANUARY = 01 F=FEBRUARY = 02 M=MARCH = 03 A=APRIL = 04\r\n MM=MAY = 05 JJ=JUNE = 06 JJJ=JULY = 07 AA=AUGUST = -8\r\n S=SEPTEMBER = 09 /O=OCTOBER = 10 N=NOVEMBER = 11 D=DECEMBER = 12"/> <TEXT TYPE Action="0"/> <DELAY Flags="\x01" Time=".33"/> <TEXT TYPE Action="0" Text="<TAB>"/> <COMMENT Value="CC SECURITY CODE\r\n 3 OR 4 DIGITS"/> <TEXT TYPE Action="0"/> <DELAY Flags="\x01" Time=".33"/> <TEXT TYPE Action="0" Text="<TAB><TAB><TAB><TAB><TAB><TAB>"/> <COMMENT Value="FIRST NAME"/> <TEXT TYPE Action="0"/> <DELAY Flags="\x01" Time=".33"/> <TEXT TYPE Action="0" Text="<TAB>"/> <COMMENT Value="LAST NAME"/> <TEXT TYPE Action="0"/> <DELAY Flags="\x01" Time=".33"/> <TEXT TYPE Action="0" Text="<TAB>"/> <COMMENT Value="ADDRESS 1"/> <TEXT TYPE Action="0"/> <DELAY Flags="\x01" Time=".33"/> <TEXT TYPE Action="0" Text="<TAB>"/> <COMMENT Value="ADDRESS 2"/> <TEXT TYPE Action="0"/> <DELAY Flags="\x01" Time=".33"/> <TEXT TYPE Action="0" Text="<TAB>"/> <COMMENT Value="CITY"/> <TEXT TYPE Action="0"/> <DELAY Flags="\x01" Time=".33"/> <TEXT TYPE Action="0" Text="<TAB><TAB>"/> <COMMENT Value="STATE / DEFAULT IS ILLINOIS"/> <TEXT TYPE Action="0" Text="ii"/> <DELAY Flags="\x01" Time=".33"/> <TEXT TYPE Action="0" Text="<TAB>"/> <COMMENT Value="ZIP CODE"/> <TEXT TYPE Action="0" Text="6"/> <DELAY Flags="\x01" Time=".33"/> <TEXT TYPE Action="0" Text="<TAB>"/> <COMMENT Value="AREA CODE"/> <TEXT TYPE Action="0"/> <DELAY Flags="\x01" Time=".33"/> <TEXT TYPE Action="0" Text="<TAB>"/> <COMMENT Value="PHONE NUMBER"/> <TEXT TYPE Action="0"/> <DELAY Flags="\x01" Time=".33"/> Quote Link to comment Share on other sites More sharing options...
acantor Posted February 22, 2023 Report Share Posted February 22, 2023 No problem using one macro to collect the data, and a second macro to output the results. The key is to end the data collection macro with this: Variable Save: Save Text Variables And to start the macro that outputs the data with this: Variable Restore: Restore Text Variables You can more-or-less divide my code into two. You may need to modify the number of tabs in the macro that spits out the answers. In the data collection macro, you will be prompted to enter the name, phone number, etc. Each value is stored in a variable, e.g., %FirstName% and %PhoneNumber%. In the data output macro, you navigate from field to field by simulating Tab presses. Here's how to output three Tabs... Text Type (Simulate Keystrokes): <TAB><TAB><TAB> When you reach the field you want, output the variable that goes in that field: Text Type (Simulate Keystrokes): %FirstName% I'm not sure what you're referring to by "VARIABLE SET COMMANDS PROMPT." For this project, you need the "Variable Set String" instruction: Variable Set String %FirstName%: Prompt Quote Link to comment Share on other sites More sharing options...
bobaol Posted February 22, 2023 Report Share Posted February 22, 2023 Hi Frank, For something like you're describing, I prefer to work with Excel (or any spreadsheet) and then copy and paste the data to the form. I would set up the data in Excel in a grid, then set the MacroExpress macro to copy and paste each piece of data into the respective field in the form. Then save the form. Of course, using key strokes like Tab is much more precise than using a mouse. Then use the MacroExpress macro to go to the next record and the next form, and loop it again. I usually use multiple applications (like Excel, NotePad, Paint, etc...) in conjunction with MacroExpress. Hope this helps. Quote Link to comment Share on other sites More sharing options...
Cartwheels Posted February 22, 2023 Report Share Posted February 22, 2023 Here is one I use for filling out forms. One section is for business info and another for personal info. You would need to fill in the appropriate places in the code for your business and work names and addresses. When your cursor is in the first name field, you would put in "fx", last name field "lx" and so on. "x" is the trigger. The macro clears out the "fx" and types in the corresponding information. h= Home Address or w= Work Address fx= First Name lx= Last Name ax= Street address cx= City zx= Zip px= Phone # ex= Email address vx= Visa bx= Business Name ox= Business Name x, pressing x is the trigger qx= Quit <COMMENT Value="h= Home Address or w= Work Adress\r\nfx= First Name\r\nlx= Last Name\r\nax= Street address\r\ncx= City\r\nz= Zip\r\npx= Phone #\r\nex= Email adress\r\nvx= Visa\r\nbx= Business Name\r\nox= Business Name\r\nx, pressing x is the trigger\r\nqx= Quit\r\n"/> <TEXT BOX DISPLAY Title="Enter a digit" Content="{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\lang1033\\f0\\fs20 F for first name\r\n\\par L for last name\r\n\\par v- visa\\fs10 \r\n\\par }\r\n" Left="Center" Top="Top" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x02" Delay="0"/> <VARIABLE SET STRING Option="\x01" Destination="%T[2]%" Prompt="w= Work\r\nh= Home" Mask="FALSE" OnTop="FALSE" Left="Center" Top="Center" Monitor="0" Lines="\x00"/> <REPEAT START Start="1" Step="1" Count="10" Save="FALSE" Variable="%N[1]%"/> <WAIT FOR KEY PRESS Key="X" Indefinite="FALSE" Hours="0" Minutes="10" Seconds="0"/> <TEXT TYPE Action="0" Text="<BACKSPACE>"/> <TEXT TYPE Action="0" Text="<SHIFTD><ARROW LEFT><SHIFTU>"/> <CLIPBOARD CUT/> <VARIABLE SET STRING Option="\x02" Destination="%T[1]%" NoEmbeddedVars="FALSE"/> <IF VARIABLE Variable="%T[2]%" Condition="\x00" Value="w" IgnoreCase="TRUE"/> <IF VARIABLE Variable="%T[1]%" Condition="\x00" Value="b" IgnoreCase="TRUE"/> <OR/> <IF VARIABLE Variable="%T[1]%" Condition="\x00" Value="o" IgnoreCase="TRUE"/> <TEXT TYPE Action="0" Text="Business Name"/> <END IF/> <IF VARIABLE Variable="%T[1]%" Condition="\x00" Value="f" IgnoreCase="TRUE"/> <TEXT TYPE Action="0" Text="Your first name here"/> <END IF/> <IF VARIABLE Variable="%T[1]%" Condition="\x00" Value="l" IgnoreCase="TRUE"/> <TEXT TYPE Action="0" Text="Your last name here"/> <END IF/> <IF VARIABLE Variable="%T[1]%" Condition="\x00" Value="e" IgnoreCase="TRUE"/> <TEXT TYPE Action="0" Text="Your email address here"/> <END IF/> <IF VARIABLE Variable="%T[1]%" Condition="\x00" Value="a" IgnoreCase="TRUE"/> <TEXT TYPE Action="0" Text="Your street adddress here"/> <TEXT TYPE Action="0" Text="<TAB>"/> <END IF/> <IF VARIABLE Variable="%T[1]%" Condition="\x00" Value="c" IgnoreCase="TRUE"/> <TEXT TYPE Action="0" Text="Your city here"/> <END IF/> <IF VARIABLE Variable="%T[1]%" Condition="\x00" Value="p" IgnoreCase="TRUE"/> <TEXT TYPE Action="0" Text="Your phone # here"/> <END IF/> <IF VARIABLE Variable="%T[1]%" Condition="\x00" Value="z" IgnoreCase="TRUE"/> <TEXT TYPE Action="0" Text="Your zip code here"/> <END IF/> <IF VARIABLE Variable="%T[1]%" Condition="\x00" Value="v" IgnoreCase="TRUE"/> <ENCRYPTED TEXT Text="A9B66887BF7BA08BA26E878DF727D61020CA76DA29E93AC5" Store="TRUE" Variable="%T[23]%"/> <TEXT TYPE Action="1" Text="%T[23]%"/> <TEXT BOX DISPLAY Title="Info" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\lang1033\\f0\\fs10 Exp Date: xx/xx\\f1 \r\n\\par \\f0 security code is: xxx\\f1 \r\n\\par }\r\n" Left="Right" Top="Top" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x02" Delay="0" _COMMENT="Displays credit card exp date and security code"/> <PAUSE Flags="\x10" Left="CENTER" Top="CENTER" Monitor="0"/> <TEXT BOX CLOSE Header="Info"/> <END IF/> <COMMENT Value="Home"/> <ELSE/> <IF VARIABLE Variable="%T[1]%" Condition="\x00" Value="f" IgnoreCase="TRUE"/> <TEXT TYPE Action="0" Text="Your first name here"/> <END IF/> <IF VARIABLE Variable="%T[1]%" Condition="\x00" Value="l" IgnoreCase="TRUE"/> <TEXT TYPE Action="0" Text="Your last name here"/> <END IF/> <IF VARIABLE Variable="%T[1]%" Condition="\x00" Value="e" IgnoreCase="TRUE"/> <TEXT TYPE Action="0" Text="Your email address here"/> <END IF/> <IF VARIABLE Variable="%T[1]%" Condition="\x00" Value="a" IgnoreCase="TRUE"/> <TEXT TYPE Action="0" Text="Your address here"/> <TEXT TYPE Action="0" Text="<TAB>"/> <END IF/> <IF VARIABLE Variable="%T[1]%" Condition="\x00" Value="c" IgnoreCase="TRUE"/> <TEXT TYPE Action="0" Text="Your city here"/> <END IF/> <IF VARIABLE Variable="%T[1]%" Condition="\x00" Value="p" IgnoreCase="TRUE"/> <TEXT TYPE Action="0" Text="Your phone here"/> <END IF/> <IF VARIABLE Variable="%T[1]%" Condition="\x00" Value="z" IgnoreCase="TRUE"/> <TEXT TYPE Action="0" Text="your zip here"/> <END IF/> <IF VARIABLE Variable="%T[1]%" Condition="\x00" Value="v" IgnoreCase="TRUE"/> <TEXT TYPE Action="0" Text="your credit card # here"/> <TEXT BOX DISPLAY Title="Info" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\lang1033\\f0\\fs10 Exp Date: xx/xx\\f1 \r\n\\par \\f0 security code is: xxx\\f1 \r\n\\par }\r\n" Left="Right" Top="Top" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x02" Delay="0" _COMMENT="Displays credit card exp date and security code"/> <PAUSE Flags="\x10" Left="CENTER" Top="CENTER" Monitor="0"/> <TEXT BOX CLOSE Header="Info"/> <END IF/> <END IF/> <DELAY Flags="\x01" Time=".3"/> <TEXT TYPE Action="0" Text="<TAB>"/> <IF VARIABLE Variable="%T[1]%" Condition="\x00" Value="q" IgnoreCase="TRUE" _COMMENT="Quit"/> <MACRO STOP/> <END IF/> <END REPEAT/> Quote Link to comment Share on other sites More sharing options...
Frank Posted February 22, 2023 Author Report Share Posted February 22, 2023 Thanks to everyone that helped... definitely learned today!!1 F Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.