Hi again,
New problem:
I want to use input, but check if the first letter is capital or not and use the appropriate tag.
Ex:
$T%INPUT_test%:%INPUT_test2%; ; if first letters are lowercase
$t%INPUT_test%:%INPUT_test2%; ; if first letters are uppercase
I tried using Insert Command Code, but I can't get the values of INPUT_test and INPUT_test2 to test for case.
If possible, I'd like to keep using macros so it's easy to explain to coleagues how to tweak this to their needs (non programmers).
Checking caps in INPUT macro
-
- Posts: 27
- Joined: Oct 3rd, ’17, 12:26
orlando2bjr
You can use Insert Command Code macro. Example:
Substitute (note that the name of Input field is "_test". "_" is added to prevent sending this value):
The content of TestUpper Command Code macro:
Substitute (note that the name of Input field is "_test". "_" is added to prevent sending this value):
Code: Select all
%INPUT__test%
%CODE_TestUpper%
Code: Select all
first:=SubStr(INPUT__test,1,1)
if first is upper
Send, This is UPPER: %INPUT__Test%
else
Send, This is LOWER: %INPUT__Test%
-
- Posts: 27
- Joined: Oct 3rd, ’17, 12:26
Worked perfectly and it's easy to explain how to tweak.
Look at the final version (except variable names):
Main Send code, without line breaks and 2 variables:
Command:
I can't thank you enough!!!
A few more tests and I'll begin recommending fastkeys to all my fellow translators.
Look at the final version (except variable names):
Main Send code, without line breaks and 2 variables:
Code: Select all
%INPUT__test%%INPUT__test2%%CODE_TestUpper%
Code: Select all
first:=SubStr(INPUT__test,1,1)
if first is upper
Send, $u%INPUT__Test%:%INPUT__Test2%;
else
Send, $U%INPUT__Test%:%INPUT__Test2%;
A few more tests and I'll begin recommending fastkeys to all my fellow translators.
orlando2bjr
You are welcome!