Jump to content
Macro Express Forums

Need more String Modification Options!


Alexis
 Share

Recommended Posts

I would like to isolate parts of Text in string variables.

 

For example the word "MEX" in the following string:

"I love my >MEX< very much!"

 

So is there a command like copy 3 characters right from > or left from <?

 

I need this for a kind of commandline activation where parts of the complete string should be saved as different string variables (T1-T4). The variables are later analysed in the macro and it reacts upon it.

 

 

Thank you

 

Alexandra

Link to comment
Share on other sites

I would like to isolate parts of Text in string variables.

 

For example the word "MEX" in the following string:

"I love my >MEX< very much!"

 

So is there a command like copy 3 characters right from > or left from <?

 

rberq hit it right on the nose. Here's my version of the macro. I have opened a Notepad and entered the text: "I love my

>MEX< very much!" and use the following commands to isolate the text in between the > and the <.

Activate Window: "Untitled - Notepad"
Text Type: <CONTROL>a
Clipboard Copy
Variable Set String %T1% from Clipboard
Variable Set Integer %N1% from Position of Text in Variable %T1%
Variable Set Integer %N2% from Position of Text in Variable %T1%
Variable Modify Integer: Inc (%N1%)
Variable Modify Integer: %N3% = %N2% - %N1%
Variable Modify String: Copy Part of %T1% to %T1%
Text Box Display: T1

 

<ACTIVATE2:Untitled - Notepad><TEXTTYPE:<CONTROL>a><CLIPC><TVAR2:01:03:><IVAR2:01:13:1:>><IVAR2:02:13:1:<><NMVAR:08:01:0:0000001:0:0000000><NMVAR:02:03:1:0000002:1:0000001><TMVAR2:10:01:01:N01:N03:><TBOX4:T:1:CenterCenter000278000200:000:T1 = %T1%>

 

I need this for a kind of commandline activation where parts of the complete string should be saved as different string variables (T1-T4). The variables are later analysed in the macro and it reacts upon it.

 

Could you give a slightly more "real world" example of what you're trying to do? It's possible to have the macro collect the

various information and assign it to different variables, but there are different ways to do it, some better than others,

depending on exactly what the situation is.

Link to comment
Share on other sites

Thank you very much guys! That are the commands i was missing. I simply did not expect to find them in the integer section.

 

Of course i can give you the real world example.

I activate macros every way i can think of. I even let Dragon Naturally Speaking trigger my MEX Library. (Works with \A commandline)

 

But there are situations where the following process makes sense.

I use Outlook to organize my tasks. There are just a few parameters critical for each task. In my situation for example those are:

 

Name of Task

Importance/Priority

Due Date

Category (Call/Home/Office)

Reminder (on/off)

 

I cannot automate this completely by a simple macro because of those varying parameters.

So i came up with a syntax were those parameters are represented by characters in a string. They are seperated by the seperation character (<). For example:

 

Name<Priority<Due Date<category<Reminder

 

String to type in would be:

 

Call mother<h<m<c<o

 

where the characters would stand for

 

High Priority

Tomorrow

Category Call

Reminder On

 

So now i press the global hotkey for the string prompt. Type it in, Return. See the outlook window flickering. Done.

 

P.S. It would be nice to get multiple positions (all instances) of <. But there is of course a workaround.

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