Jump to content
Macro Express Forums

Text Typing An Expression


Recommended Posts

This is my first post here. Glad to be a new ME user.

 

I am reading an expression from a .csv file, for instance: %T2%\%T6%.wav. I am storing this expression in variable T93. I need to type the expression in a text box. Using the Text Type command, I enter the following text: %T93%. During execution, the macro types %T2%\%T6%.wav and does not substitute the values for T2 and T6.

 

How can I make the macro substitute the values for T2 and T6?

 

Thanks!

Link to post
Share on other sites

You say you are typing %t2% into the text type. You can't just type it, you must use the drop down for the VARIABLES at the bottom part of the text type window, choose the variable you want and then click on the INSERT button right next to it.

 

Try that if you were just typing it in.

Link to post
Share on other sites
You say you are typing %t2% into the text type.  You can't just type it, you must use the drop down for the VARIABLES at the bottom part of the text type window, choose the variable you want and then click on the INSERT button right next to it. 

 

Try that if you were just typing it in.

Thank you for the suggestion. This is something I tried before submitting the question. It makes no difference if I use the Variable drop-down list or if I type it in manually. I use the Text Type command several times in this macro and 99% of the time, I have typed in the variables and have had no problems whatsoever.

Link to post
Share on other sites
Copy the code of your macro and post that up so we can read it.

When you post click the CODE button, paste your code, then click the CODE button again to "wrap" it.

Here is the simplified code. The values of T2 and T6 change constantly during execution.

 

<TVAR2:02:01:c:\audio2><TVAR2:06:01:01><ADFBEG:F10:090:000001:000000:C:\Audio\Utils\xy_surcodecd.csv><TMVAR2:05:91:91:000:000:><TMVAR2:05:92:92:000:000:><MMW2:91N,92N><LCLK><TDELAY:0.50><IFVAR2:1:93:2:><TEXTTYPE:%T93%<ENTER>><TDELAY:0.50><WAITWLF2:000000:000000:Select a File><ENDIF><ADFEND>

 

To understand where I'm going with this, you need to see the comma-delimited data file that I'm reading from (first variable being T90):

 

surcodecd_first C_button,414,177,

surcodecd_second C_button,413,199,

surcodecd_third C_button,414,223,

surcodecd_fourth C_button,415,249,

surcodecd_fifth C_button,414,273,

surcodecd_sixth C_button,414,298,

surcodecd_Start R_button,247,347,

surcodecd_End R_button,247,373,

surcodecd_Destination..._button,107,122,%T2%\DTS\%T6%.wav

surcodecd_Left Front..._button,143,176,%T2%\%T6%0.wav

surcodecd_Right Front..._button,145,201,%T2%\%T6%1.wav

surcodecd_Center..._button,143,225,%T2%\%T6%2.wav

surcodecd_Left Surr..._button,144,273,%T2%\%T6%4.wav

surcodecd_Right Surr..._button,143,298,%T2%\%T6%5.wav

surcodecd_Encode_button,53,349,

 

Basically, what this macro does is pressing various buttons in a window. Some buttons open a text box in which the macro types data.

 

By the way, the reason I store mouse positions in a file is that this file is the result of a "calibration" that each user needs to go through before using the macro for the first time or whenever something happens (ex: change screen resolution) that affects where the mouse is moving inside a window. This guarantees that the macro will work for every user no matter what they do with their screen. Unfortunately, the controls in this window are useless and do not work with the Get Control technique.

 

Thanks.

Link to post
Share on other sites

My understanding of how ME handles text files is that it reads the text verbatim. In other words, what's in the file is what you get--with no replacements of variables. The solution for you is simple, though:

 

1. Use another place holder for the variable in the file. Say, instead of %T2%, use something like PATH.

 

2. Immediately after the file read, add a modify text string command to replace PATH with %T2%.

<TMVAR2:21:01:00:000:000:PATH%T2%>

 

3. Take the same approach with all other variables in the csv file.

 

I hope that helps.

--Dennis

Link to post
Share on other sites

There is an advanced preference that will make your macro work.

 

If you are using Macro Express v 3.7 or later then click on Options, Preferences, Miscellaneous. Click on the Advanced button and enter a number in 'Variables Evaluation Level'. To test your macro I used a value of 2. For a description of what this option does see the Advanced Options web page.

 

If you are using a version of Macro Express prior to v 3.7 you will need to download TweakME3.mxe from the downmore web page.

Link to post
Share on other sites
There is an advanced preference that will make your macro work.

 

If you are using Macro Express v 3.7 or later then click on Options, Preferences, Miscellaneous. Click on the Advanced button and enter a number in 'Variables Evaluation Level'. To test your macro I used a value of 2. For a description of what this option does see the Advanced Options web page.

 

If you are using a version of Macro Express prior to v 3.7 you will need to download TweakME3.mxe from the downmore web page.

You got it! That's exactly what I was looking for. I tested it and it works perfectly. Thanks a lot!

 

In answer to Dennis's suggestion, if I understand it correctly, it doesn't eliminate the problem of a variable within a variable. I still end up literally typing text that contains variables, not the values of these variables.

Link to post
Share on other sites
You say you are typing %t2% into the text type.  You can't just type it, you must use the drop down for the VARIABLES at the bottom part of the text type window, choose the variable you want and then click on the INSERT button right next to it. 

 

Try that if you were just typing it in.

Note that you can type %T2% directly but you must use upper case T... This should increase johnboy691's development process :D

Link to post
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...