Jump to content
Macro Express Forums

Copy paste all variables, from macro_x, to macro_y ?


Recommended Posts

Hello,

 

It's gonna be horrible, I don't find a way to copy all my variables from this macro :

92156420161026101020.jpg

(the list is bigger)

 

To my others macros.

 

I use a lot of "Macro Run:", to load options, to optimize, make it more dynamic, more... And I just can't pass few hours to redefine manualy all my variables...

 

This list is only one macro :

60844620161026101535.jpg

 

Anyone have a way to copy past the variables ?

Link to comment
Share on other sites

If I'm missing the point here, I apologize in advance.

 

I have written macros to do nothing but save a large number of variables in Environment Variables, and to load them back when needed. So I would run the Save macro at the end of each functional macro; and run the Load macro at the beginning of each. This worked fine as long as I didn't exceed the allowable size of the Environment Variable(s) used for storage. As I recall, I converted integer and decimal variables to fixed-length text strings so dozens of them could be stored into a single Environment Variable; but used separate Environment Variables for each text variable.

 

It is a fair amount of work to write the Save and Restore macros, but you only have to do it once; then insert the Macro Run commands at the beginning and end of your other macros. Or if you don't want to use Macro Run for the Save and Load, you can have blocks of code that you copy into your other macros -- that's more work because you have to redo all the copying every time you add or change a variable.

Link to comment
Share on other sites

 

I don't find a way to copy all my variables from this macro :

 

Are you trying to copy the variable definitions or the contents of the variables?

 

I never worry about copying the variable definitions. They are automatically created by prompts when I use a variable in a command.

Link to comment
Share on other sites

Are you trying to copy the variable definitions or the contents of the variables?

 

I never worry about copying the variable definitions. They are automatically created by prompts when I use a variable in a command.

Samrae: Not for TBD commands though?

 

As per my post recently, like ikodan, I've been looking for some way to get variable definitions copied across. I'm away on holiday right now and have roughed out a macro I intend to write to do this when back at my PC.

Link to comment
Share on other sites

There are some commands that don't prompt to generate the variable, I can't remember which now off the top of my head. And you need to be careful to get the right type. I some cases MEP accepts multiple types. Then of course scope, number of elements, and so forth..

Link to comment
Share on other sites

Okay, thanks.

 

I guess everyone has different techniques to write macros. You and Cory are correct, there are some commands that do not prompt to create a variable. However, I have found that it is rare (never?) that I use a variable in a macro without having used at lease one of the macro commands that does prompt to create a variable.

 

But, here is an idea that may help ikodan. It is a solution to only half of the problem but maybe the second part can be accomplished via a macro to define variables in a macro.

 

When you export a macro as a Playable macro it is saved to a file with a file extension of .mxe. The content of this file, however, is in ASCII text format and can be edited with notepad or another text editor. All of the variables are listed at the top of the .mxe file. Here is an example:

<<Macro Express 4 Playable Macro>>
[string:%T% elements:99 global:true]
[integer:%N% elements:99 global:true]
[float:%D% elements:99 global:true]
[control:%C% elements:99 global:true]
[string:%IP_Address% elements:0 global:true]
[string:%ConsoleID% elements:0 global:true]
[string:%ProgramVersionNumber% elements:0 global:true]
[string:%TAB2% elements:0 global:true]
[string:%TAB3% elements:0 global:true]
[string:%TAB% elements:0 global:true]
[string:%TAB4% elements:0 global:true]
[integer:%MaxCPUs% elements:0 global:true]
[integer:%Idx% elements:0 global:true]
[integer:%CPU Idx% elements:0 global:true]
[string:%CPU Identifier% elements:50 global:true]
[string:%CPU ProcessorNameString% elements:50 global:true]
[string:%CPU VendorIdentifier% elements:50 global:true]
[integer:%CPU Counter% elements:0 global:true]
[string:%WindowsStr% elements:0 global:true]
[string:%WindowsSP% elements:0 global:true]
[string:%CR% elements:0 global:true]
[string:%LF% elements:0 global:true]
[string:%TAB5% elements:0 global:true]
[string:%MacroName% elements:0 global:true]
[string:%sTemp% elements:0 global:true]
<<BEGIN SCRIPT>>
Link to comment
Share on other sites

Here's the macro I said I'd post on return from holiday.

 

Wish I'd seen your post about MXE files a few hours earlier, Samrae! I'd almost finished the macro, but it was based on my own method of identifying the variable type (tStringXyz is a text macro, nNumber an integer, dValue decimal, etc). Your MXE export idea allowed the following more flexible approach, which works for any style of variable naming.

 

However, note that this works only for MX Pro, not MX3. Exports from the latter seem to be in a radically different form, based on the couple of old examples I found. The 'input' section for MX3 could instead follow my earlier method of first creating a text file from the target and the 'addition' section could be very similar to this one.

 

It's not blisteringly fast, but a LOT faster than doing the job manually. About 1.5 seconds per variable on my first few tests, the largest with about 80 variables, mainly text.

 

The major advantage I see for automating this is that it's so much easier to ensure identical variable names. Not having to remember or search for the names used before, with possible ambiguity and confusion if I vary them.

See other notes in command comments.

// Export the source macro as MXE (MX Pro only, not MX3).
// Select the source macro containing the variables for copying across to the target macro
 
Text Box Display: Select source macro
Wait for Right Mouse Click
Text Box Close: Select source macro
Text Type (Simulate Keystrokes): x // Choose Export
Delay: 0.2 seconds
Text Type (Simulate Keystrokes): p // Choose Playable (MXE)
Delay: 0.2 seconds
// Save the MXE as a TXT file with a permanent name and path of your choice.
Text Type (Use Clipboard and Paste Text): C:\Users\terry\Dropbox\Macro Express (Sundry)\ExportedMXE.txt // Choose Playable (MXE)
Wait for Text Playback
Mouse Move: 790, 564 Relative to Current Window // Save button
Mouse Left Click
Text Type (Simulate Keystrokes): y // Yes to overwrite
Delay: 0.1 seconds
Wait for File to Exist: C:\Users\terry\Dropbox\Macro Express (Sundry)\ExportedMXE.txt
// In MX Explorer, select the TARGET macro to receive the copied variables
Text Box Display: Select target macro
Wait for Right Mouse Click
Text Box Close: Select target macro
Text Type (Simulate Keystrokes): i // Open the target macro in Script Editor
Wait for Window Title: Macro Express Pro - Script Editor [
// Procees the exported text file, line by line.
Text File Begin Process: C:\Users\terry\Dropbox\Macro Express (Sundry)\ExportedMXE.txt
// Do nothing if the line does not start with '['.
// If it DOES start with a right square bracket, it contains variable information which needs parsing, ready for adding to the target macro.
 
  Variable Modify String: Copy a substring in %tTextLine%, starting at 1 and 1 characters long to %tFirstChar%
  If Variable %tFirstChar% Does not Equal "[" // Ignore this text line
    Continue
  End If
  // This is a variable, but it might be one of the built-in types.
  If Variable %tTextLine% Contains "%T%" // Ignore this text line
    OR
  If Variable %tTextLine% Contains "%N%" // Ignore this text line
    OR
  If Variable %tTextLine% Contains "%D%" // Ignore this text line
    OR
  If Variable %tTextLine% Contains "%C%" // Ignore this text line
  // Then ignore this too.
    Continue
  End If
  // This is a variable
  // Locate the first colon ': ', in order to capture the variable type.
  Variable Set Integer %nColon% to the position of ":" in %tTextLine%
  Variable Modify Integer: %nColon% = %nColon% - 2
  Variable Modify String: Copy a substring in %tTextLine%, starting at 2 and %nColon% characters long to %tVariableType%
   
  // Locate the first '% ' (at the end of the variable name).
  Variable Set Integer %nEndVariable% to the position of "% " in %tTextLine%
  Variable Modify Integer %nEndVariable%: Decrement // Last char in variable name
  // Calculate nVarStart, the first char of variable name.
  Variable Set Integer %nVarStart% to 0
  Variable Modify Integer: %nVarStart% = %nColon% + 4
  // Calculate nVarNum, the number of chars in variable name.
  Variable Set Integer %nVarNum% to 0
  Variable Modify Integer: %nVarNum% = %nEndVariable% - %nColon%
  Variable Modify Integer: %nVarNum% = %nVarNum% - 3
  Variable Modify String: Copy a substring in %tTextLine%, starting at %nVarStart% and %nVarNum% characters long to %tVariableName%
  // NOTE: Some of the labels used in the MXE are different to those in the Script Editor. 
string = Text
integer = Integer
float = Decimal
control = Control
handle = Handle
bool = Boolean
large integer = Large Integer
datetime = Date/Time

  // NOTE: The two other variable data fields Global and Elements could also be captured at this stage. But for 99% of my work they are not used, so I've not done so.
      
  Macro Playback Speed: 0.33 times faster than normal
  Switch( %tVariableType% )
  Case: string // Text
  // Add the selected variable to the target macro
    Mouse Move: 1340, 120 Relative to Screen // Variables tab
    Mouse Left Click
    Delay: 0.1 seconds
    Mouse Move: 1720, 1092 Relative to Screen // Add button
    Mouse Left Click
    Delay: 0.3 seconds
    Wait for Window Title: Variable Properties
    Text Type (Simulate Keystrokes): %tVariableName%
    Delay: 0.1 seconds
    Text Type (Simulate Keystrokes): <TAB> // Select Variable Type box
    Delay: 0.1 seconds
    Text Type (Simulate Keystrokes): t
    Delay: 0.1 seconds
    Text Type (Simulate Keystrokes): <ENTER> // Confirm
    Delay: 0.1 seconds
  End Case
  Case: integer // Integer
  // Add the selected variable to the target macro
    Mouse Move: 1340, 120 Relative to Screen // Variables tab
    Mouse Left Click
    Delay: 0.1 seconds
    Mouse Move: 1720, 1092 Relative to Screen // Add button
    Mouse Left Click
    Delay: 0.3 seconds
    Wait for Window Title: Variable Properties
    Text Type (Simulate Keystrokes): %tVariableName%
    Delay: 0.1 seconds
    Text Type (Simulate Keystrokes): <TAB> // Select Variable Type box
    Delay: 0.1 seconds
    Text Type (Simulate Keystrokes): i
    Delay: 0.1 seconds
    Text Type (Simulate Keystrokes): <ENTER> // Confirm
    Delay: 0.1 seconds
  End Case
  Case: float // Decimal
  // Add the selected variable to the target macro
    Mouse Move: 1340, 120 Relative to Screen // Variables tab
    Mouse Left Click
    Delay: 0.1 seconds
    Mouse Move: 1720, 1092 Relative to Screen // Add button
    Mouse Left Click
    Delay: 0.3 seconds
    Wait for Window Title: Variable Properties
    Text Type (Simulate Keystrokes): %tVariableName%
    Delay: 0.1 seconds
    Text Type (Simulate Keystrokes): <TAB> // Select Variable Type box
    Delay: 0.1 seconds
    Text Box Display: 
    Text Type (Simulate Keystrokes): d
    Delay: 0.1 seconds
    Text Type (Simulate Keystrokes): <ENTER> // Confirm
    Delay: 0.1 seconds
  End Case
  Case: control // Control
  // Add the selected variable to the target macro
    Mouse Move: 1340, 120 Relative to Screen // Variables tab
    Mouse Left Click
    Delay: 0.1 seconds
    Mouse Move: 1720, 1092 Relative to Screen // Add button
    Mouse Left Click
    Delay: 0.3 seconds
    Wait for Window Title: Variable Properties
    Text Type (Simulate Keystrokes): %tVariableName%
    Delay: 0.1 seconds
    Text Type (Simulate Keystrokes): <TAB> // Select Variable Type box
    Delay: 0.1 seconds
    Text Type (Simulate Keystrokes): c
    Delay: 0.1 seconds
    Text Type (Simulate Keystrokes): <ENTER> // Confirm
    Delay: 0.1 seconds
  End Case
  Case: large integer // Large integer
  // Add the selected variable to the target macro
    Mouse Move: 1340, 120 Relative to Screen // Variables tab
    Mouse Left Click
    Delay: 0.1 seconds
    Mouse Move: 1720, 1092 Relative to Screen // Add button
    Mouse Left Click
    Delay: 0.3 seconds
    Wait for Window Title: Variable Properties
    Text Type (Simulate Keystrokes): %tVariableName%
    Delay: 0.1 seconds
    Text Type (Simulate Keystrokes): <TAB> // Select Variable Type box
    Delay: 0.1 seconds
    Text Type (Simulate Keystrokes): l
    Delay: 0.1 seconds
    Text Type (Simulate Keystrokes): <ENTER> // Confirm
    Delay: 0.1 seconds
  End Case
  Case: bool // Boolean
  // Add the selected variable to the target macro
    Mouse Move: 1340, 120 Relative to Screen // Variables tab
    Mouse Left Click
    Delay: 0.1 seconds
    Mouse Move: 1720, 1092 Relative to Screen // Add button
    Mouse Left Click
    Delay: 0.3 seconds
    Wait for Window Title: Variable Properties
    Text Type (Simulate Keystrokes): %tVariableName%
    Delay: 0.1 seconds
    Text Type (Simulate Keystrokes): <TAB> // Select Variable Type box
    Delay: 0.1 seconds
    Text Type (Simulate Keystrokes): b
    Delay: 0.1 seconds
    Text Type (Simulate Keystrokes): <ENTER> // Confirm
    Delay: 0.1 seconds
  End Case
  Case: handle // Handle
  // Add the selected variable to the target macro
    Mouse Move: 1340, 120 Relative to Screen // Variables tab
    Mouse Left Click
    Delay: 0.1 seconds
    Mouse Move: 1720, 1092 Relative to Screen // Add button
    Mouse Left Click
    Delay: 0.3 seconds
    Wait for Window Title: Variable Properties
    Text Type (Simulate Keystrokes): %tVariableName%
    Delay: 0.1 seconds
    Text Type (Simulate Keystrokes): <TAB> // Select Variable Type box
    Delay: 0.1 seconds
    Text Type (Simulate Keystrokes): h
    Delay: 0.1 seconds
    Text Type (Simulate Keystrokes): <ENTER> // Confirm
    Delay: 0.1 seconds
  End Case
  Case: datetime // Date/Time
    Mouse Move: 1340, 120 Relative to Screen // Variables tab
    Mouse Left Click
    Delay: 0.1 seconds
    Mouse Move: 1720, 1092 Relative to Screen // Add button
    Mouse Left Click
    Delay: 0.3 seconds
    Wait for Window Title: Variable Properties
    Text Type (Simulate Keystrokes): %tVariableName%
    Delay: 0.1 seconds
    Text Type (Simulate Keystrokes): <TAB> // Select Variable Type box
    Delay: 0.1 seconds
    Text Type (Simulate Keystrokes): d
    Delay: 0.1 seconds
    Text Type (Simulate Keystrokes): <ARROW DOWN>
    Delay: 0.1 seconds
    Text Type (Simulate Keystrokes): <ENTER> // Confirm
    Delay: 0.1 seconds
  End Case
  End Switch
  Delay: 0.1 seconds
Text File End Process

And the code:

<COMMENT Value="Export the source macro as MXE (MX Pro only, not MX3)."/>
<COMMENT Value="Select the source macro containing the variables for copying across to the target macro"/>
<COMMENT/>
<TEXT BOX DISPLAY Title="Select source macro" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n{\\colortbl ;\\red255\\green0\\blue0;}\r\n\\viewkind4\\uc1\\pard\\qc\\b\\f0\\fs20 In MX Explorer, navigate to the source macro, select it, and \\cf1 right-click\\cf0  it.\r\n\\par \r\n\\par This message will close automatically.\\f1 \r\n\\par }\r\n" Left="868" Top="485" Width="313" Height="183" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x02" Delay="0"/>
<WAIT FOR RIGHT MOUSE CLICK Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<TEXT BOX CLOSE Header="Select source macro"/>
<TEXT TYPE Action="0" Text="x" _COMMENT="Choose Export"/>
<DELAY Flags="\x01" Time="0.2"/>
<TEXT TYPE Action="0" Text="p" _COMMENT="Choose Playable (MXE)"/>
<DELAY Flags="\x01" Time="0.2"/>
<COMMENT Value="Save the MXE as a TXT file with a permanent name and path of your choice."/>
<TEXT TYPE Action="1" Text="C:\\Users\\terry\\Dropbox\\Macro Express (Sundry)\\ExportedMXE.txt" _COMMENT="Choose Playable (MXE)"/>
<WAIT FOR TEXT PLAYBACK Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<MOUSE MOVE Option="\x02" X="790" Y="564" _PROMPT="0x000A" _COMMENT="Save button"/>
<MOUSE LEFT CLICK/>
<TEXT TYPE Action="0" Text="y" _COMMENT="Yes to overwrite"/>
<DELAY Flags="\x01" Time="0.1"/>
<WAIT FOR FILE TO EXIST Filename="C:\\Users\\terry\\Dropbox\\Macro Express (Sundry)\\ExportedMXE.txt" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<COMMENT Value="In MX Explorer, select the TARGET macro to receive the copied variables"/>
<TEXT BOX DISPLAY Title="Select target macro" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n{\\colortbl ;\\red255\\green0\\blue0;}\r\n\\viewkind4\\uc1\\pard\\qc\\b\\f0\\fs20 In MX Explorer, navigate to and \\cf1 right click\\cf0  the target macro.\r\n\\par \r\n\\par This message will close automatically.\\f1 \r\n\\par }\r\n" Left="868" Top="485" Width="313" Height="183" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x02" Delay="0"/>
<WAIT FOR RIGHT MOUSE CLICK Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<TEXT BOX CLOSE Header="Select target macro"/>
<TEXT TYPE Action="0" Text="i" _COMMENT="Open the target macro in Script Editor"/>
<WAIT FOR WINDOW TITLE Title="Macro Express Pro - Script Editor [" Partial="TRUE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<COMMENT Value="Procees the exported text file, line by line."/>
<TEXT FILE BEGIN PROCESS Filename="C:\\Users\\terry\\Dropbox\\Macro Express (Sundry)\\ExportedMXE.txt" Start_Record="2" Process_All="TRUE" Records="1" Variable="%tTextLine%"/>
<COMMENT Value="Do nothing if the line does not start with '['."/>
<COMMENT Value="If it DOES start with a right square bracket, it contains variable information which needs parsing, ready for adding to the target macro."/>
<COMMENT/>
<VARIABLE MODIFY STRING Option="\x09" Destination="%tFirstChar%" Variable="%tTextLine%" Start="1" Count="1" NoEmbeddedVars="FALSE"/>
<IF VARIABLE Variable="%tFirstChar%" Condition="\x01" Value="[" IgnoreCase="FALSE" _COMMENT="Ignore this text line"/>
<CONTINUE/>
<END IF/>
<COMMENT Value="This is a variable, but it might be one of the built-in types."/>
<IF VARIABLE Variable="%tTextLine%" Condition="\x06" Value="%T%" IgnoreCase="FALSE" _COMMENT="Ignore this text line"/>
<OR/>
<IF VARIABLE Variable="%tTextLine%" Condition="\x06" Value="%N%" IgnoreCase="FALSE" _COMMENT="Ignore this text line"/>
<OR/>
<IF VARIABLE Variable="%tTextLine%" Condition="\x06" Value="%D%" IgnoreCase="FALSE" _COMMENT="Ignore this text line"/>
<OR/>
<IF VARIABLE Variable="%tTextLine%" Condition="\x06" Value="%C%" IgnoreCase="FALSE" _COMMENT="Ignore this text line"/>
<COMMENT Value="Then ignore this too."/>
<CONTINUE/>
<END IF/>
<COMMENT Value="This is a variable"/>
<COMMENT Value="Locate the first colon ': ', in order to capture the variable type."/>
<VARIABLE SET INTEGER Option="\x0E" Destination="%nColon%" Text_Variable="%tTextLine%" Text=":" Ignore_Case="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x01" Destination="%nColon%" Value1="%nColon%" Value2="2"/>
<VARIABLE MODIFY STRING Option="\x09" Destination="%tVariableType%" Variable="%tTextLine%" Start="2" Count="%nColon%" NoEmbeddedVars="FALSE"/>
<COMMENT/>
<COMMENT Value="Locate the first '% ' (at the end of the variable name)."/>
<VARIABLE SET INTEGER Option="\x0E" Destination="%nEndVariable%" Text_Variable="%tTextLine%" Text="% " Ignore_Case="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x08" Destination="%nEndVariable%" _COMMENT="Last char in variable name"/>
<COMMENT Value="Calculate nVarStart, the first char of variable name."/>
<VARIABLE SET INTEGER Option="\x00" Destination="%nVarStart%" Value="0"/>
<VARIABLE MODIFY INTEGER Option="\x00" Destination="%nVarStart%" Value1="%nColon%" Value2="4"/>
<COMMENT Value="Calculate nVarNum, the number of chars in variable name."/>
<VARIABLE SET INTEGER Option="\x00" Destination="%nVarNum%" Value="0"/>
<VARIABLE MODIFY INTEGER Option="\x01" Destination="%nVarNum%" Value1="%nEndVariable%" Value2="%nColon%"/>
<VARIABLE MODIFY INTEGER Option="\x01" Destination="%nVarNum%" Value1="%nVarNum%" Value2="3"/>
<VARIABLE MODIFY STRING Option="\x09" Destination="%tVariableName%" Variable="%tTextLine%" Start="%nVarStart%" Count="%nVarNum%" NoEmbeddedVars="FALSE"/>
<COMMENT Value="NOTE: Some of the labels used in the MXE are different to those in the Script Editor. \r\nstring = Text\r\ninteger = Integer\r\nfloat = Decimal\r\ncontrol = Control\r\nhandle = Handle\r\nbool = Boolean\r\nlarge integer = Large Integer\r\ndatetime = Date/Time\r\n"/>
<COMMENT Value="NOTE: The two other variable data fields Global and Elements could also be captured at this stage. But for 99% of my work they are not used, so I've not done so."/>
<COMMENT/>
<MACRO PLAYBACK SPEED Speed="3" _ENABLED="FALSE"/>
<SWITCH Variable="%tVariableType%"/>
<CASE Value="string" _COMMENT="Text"/>
<COMMENT Value="Add the selected variable to the target macro"/>
<MOUSE MOVE Option="\x01" X="1340" Y="120" _PROMPT="0x000A" _COMMENT="Variables tab"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="0.1"/>
<MOUSE MOVE Option="\x01" X="1720" Y="1092" _PROMPT="0x000A" _COMMENT="Add button"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="0.3"/>
<WAIT FOR WINDOW TITLE Title="Variable Properties" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<TEXT TYPE Action="0" Text="%tVariableName%"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT TYPE Action="0" Text="<TAB>" _COMMENT="Select Variable Type box"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT TYPE Action="0" Text="t"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT TYPE Action="0" Text="<ENTER>" _COMMENT="Confirm"/>
<DELAY Flags="\x01" Time="0.1"/>
<END CASE/>
<CASE Value="integer" _COMMENT="Integer"/>
<COMMENT Value="Add the selected variable to the target macro"/>
<MOUSE MOVE Option="\x01" X="1340" Y="120" _PROMPT="0x000A" _COMMENT="Variables tab"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="0.1"/>
<MOUSE MOVE Option="\x01" X="1720" Y="1092" _PROMPT="0x000A" _COMMENT="Add button"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="0.3"/>
<WAIT FOR WINDOW TITLE Title="Variable Properties" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<TEXT TYPE Action="0" Text="%tVariableName%"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT TYPE Action="0" Text="<TAB>" _COMMENT="Select Variable Type box"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT TYPE Action="0" Text="i"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT TYPE Action="0" Text="<ENTER>" _COMMENT="Confirm"/>
<DELAY Flags="\x01" Time="0.1"/>
<END CASE/>
<CASE Value="float" _COMMENT="Decimal"/>
<COMMENT Value="Add the selected variable to the target macro"/>
<MOUSE MOVE Option="\x01" X="1340" Y="120" _PROMPT="0x000A" _COMMENT="Variables tab"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="0.1"/>
<MOUSE MOVE Option="\x01" X="1720" Y="1092" _PROMPT="0x000A" _COMMENT="Add button"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="0.3"/>
<WAIT FOR WINDOW TITLE Title="Variable Properties" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<TEXT TYPE Action="0" Text="%tVariableName%"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT TYPE Action="0" Text="<TAB>" _COMMENT="Select Variable Type box"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT BOX DISPLAY Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 Now add this DECIMAL variable\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0" _ENABLED="FALSE"/>
<TEXT TYPE Action="0" Text="d"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT TYPE Action="0" Text="<ENTER>" _COMMENT="Confirm"/>
<DELAY Flags="\x01" Time="0.1"/>
<END CASE/>
<CASE Value="control" _COMMENT="Control"/>
<COMMENT Value="Add the selected variable to the target macro"/>
<MOUSE MOVE Option="\x01" X="1340" Y="120" _PROMPT="0x000A" _COMMENT="Variables tab"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="0.1"/>
<MOUSE MOVE Option="\x01" X="1720" Y="1092" _PROMPT="0x000A" _COMMENT="Add button"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="0.3"/>
<WAIT FOR WINDOW TITLE Title="Variable Properties" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<TEXT TYPE Action="0" Text="%tVariableName%"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT TYPE Action="0" Text="<TAB>" _COMMENT="Select Variable Type box"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT TYPE Action="0" Text="c"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT TYPE Action="0" Text="<ENTER>" _COMMENT="Confirm"/>
<DELAY Flags="\x01" Time="0.1"/>
<END CASE/>
<CASE Value="large integer" _COMMENT="Large integer"/>
<COMMENT Value="Add the selected variable to the target macro"/>
<MOUSE MOVE Option="\x01" X="1340" Y="120" _PROMPT="0x000A" _COMMENT="Variables tab"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="0.1"/>
<MOUSE MOVE Option="\x01" X="1720" Y="1092" _PROMPT="0x000A" _COMMENT="Add button"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="0.3"/>
<WAIT FOR WINDOW TITLE Title="Variable Properties" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<TEXT TYPE Action="0" Text="%tVariableName%"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT TYPE Action="0" Text="<TAB>" _COMMENT="Select Variable Type box"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT TYPE Action="0" Text="l"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT TYPE Action="0" Text="<ENTER>" _COMMENT="Confirm"/>
<DELAY Flags="\x01" Time="0.1"/>
<END CASE/>
<CASE Value="bool" _COMMENT="Boolean"/>
<COMMENT Value="Add the selected variable to the target macro"/>
<MOUSE MOVE Option="\x01" X="1340" Y="120" _PROMPT="0x000A" _COMMENT="Variables tab"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="0.1"/>
<MOUSE MOVE Option="\x01" X="1720" Y="1092" _PROMPT="0x000A" _COMMENT="Add button"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="0.3"/>
<WAIT FOR WINDOW TITLE Title="Variable Properties" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<TEXT TYPE Action="0" Text="%tVariableName%"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT TYPE Action="0" Text="<TAB>" _COMMENT="Select Variable Type box"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT TYPE Action="0" Text="b"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT TYPE Action="0" Text="<ENTER>" _COMMENT="Confirm"/>
<DELAY Flags="\x01" Time="0.1"/>
<END CASE/>
<CASE Value="handle" _COMMENT="Handle"/>
<COMMENT Value="Add the selected variable to the target macro"/>
<MOUSE MOVE Option="\x01" X="1340" Y="120" _PROMPT="0x000A" _COMMENT="Variables tab"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="0.1"/>
<MOUSE MOVE Option="\x01" X="1720" Y="1092" _PROMPT="0x000A" _COMMENT="Add button"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="0.3"/>
<WAIT FOR WINDOW TITLE Title="Variable Properties" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<TEXT TYPE Action="0" Text="%tVariableName%"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT TYPE Action="0" Text="<TAB>" _COMMENT="Select Variable Type box"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT TYPE Action="0" Text="h"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT TYPE Action="0" Text="<ENTER>" _COMMENT="Confirm"/>
<DELAY Flags="\x01" Time="0.1"/>
<END CASE/>
<CASE Value="datetime" _COMMENT="Date/Time"/>
<MOUSE MOVE Option="\x01" X="1340" Y="120" _PROMPT="0x000A" _COMMENT="Variables tab"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="0.1"/>
<MOUSE MOVE Option="\x01" X="1720" Y="1092" _PROMPT="0x000A" _COMMENT="Add button"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="0.3"/>
<WAIT FOR WINDOW TITLE Title="Variable Properties" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<TEXT TYPE Action="0" Text="%tVariableName%"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT TYPE Action="0" Text="<TAB>" _COMMENT="Select Variable Type box"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT TYPE Action="0" Text="d"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT TYPE Action="0" Text="<ARROW DOWN>"/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT TYPE Action="0" Text="<ENTER>" _COMMENT="Confirm"/>
<DELAY Flags="\x01" Time="0.1"/>
<END CASE/>
<END SWITCH/>
<DELAY Flags="\x01" Time="0.1"/>
<TEXT FILE END PROCESS/>



And the MEX is attached. Naturally it will require some customising for folder locations etc.

 

--

Terry, East Grinstead, UK

CopyVariablesFromSourceToTarget.mex

  • Like 1
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...