Jump to content
Macro Express Forums

Pulling Data from a Variable


Recommended Posts

Phone: 262-222-2222

%Line% will give me whole line

 

Phone: 262-222-2222

If this was in a text file I would do a control, shift, arrow, arrow, then arrow, arrow, shift, end to select just the phone number and add to variable. (Two Slow)

 

 

Phone: 262-222-2222

But I'm on the clipboard - not text file

From the clip board I want to copy only phone number to variable %Phone%

Problem: Don't know how.

 

Bob

 

P.S. Please disregard prior message in forum.

Link to comment
Share on other sites

I kind of figured that's what I Had to do. When it's in a line I can do the following (Thanks to you guy's).

// Place Clipboard into Variable

Variable Set to ASCII Char 13 to %CR%

Variable Set to ASCII Char 10 to %LF%

Variable Set String %Content% from the clipboard contents

Split String "%Content%" on "%CR%%LF%" into %Line%, starting at 1

// Place values from SelectPhone into Excel

Delay: 250 milliseconds

Window Activate: Microsoft Excel

Text Type (Simulate Keystrokes): %Line[1]%

 

The problem is "Phone: ". I know it's there but I can't, so to speak, see it. I could save it to a edit program and know exactly what I need to do but that's defeating the purpose. It seems I'm trying to see what's out there on the clouds.

Link to comment
Share on other sites

%line% is not %line[1]% FWIW.

 

If you just wanted to strip the number, why do you want to retain the text: "phone:'? if you want to see it maybe display a message box with the variable containing it as the message? (this for debug purposes)

 

If the text "phone:" is sometimes that string and sometimes something else, then you need to test it to see what it is to suit your purpose. This will require that you know the range of possibilities for it.

 

 

 

 

 

 

 

 

 

 

 

 

 

I kind of figured that's what I Had to do. When it's in a line I can do the following (Thanks to you guy's).

// Place Clipboard into Variable

Variable Set to ASCII Char 13 to %CR%

Variable Set to ASCII Char 10 to %LF%

Variable Set String %Content% from the clipboard contents

Split String "%Content%" on "%CR%%LF%" into %Line%, starting at 1

// Place values from SelectPhone into Excel

Delay: 250 milliseconds

Window Activate: Microsoft Excel

Text Type (Simulate Keystrokes): %Line[1]%

 

The problem is "Phone: ". I know it's there but I can't, so to speak, see it. I could save it to a edit program and know exactly what I need to do but that's defeating the purpose. It seems I'm trying to see what's out there on the clouds.

Link to comment
Share on other sites

Yeah I am trying to do just that but I am looking for the Phone number to be in the Variable, not the "Phone:" "Phone: is only stating the items that come before the value,#, that I need.

 

"Phone: " is always at the same position and always the same text "Phone: "

Link to comment
Share on other sites

I went ahead and put in the delay on every command, which kinda makes me feel like I'm taking a bucket of delays and throwing it at the program but I don't really know what I'm doing. I don't know how many times I've read the delay instructions. But we still don't understand exactly how it works as far as, well to me it seems like the delay is supposed to work just for the one command. We tried to find a place that would show us how many milliseconds the program is running at, true every machine is different. If I at some point suspect a timing issue and I use a delay at 0 would that be placing the system back to normal speed?

 

Any help in this matter would be useful although I've made a fix in the macro by throwing delays everywhere.

 

We're also curious if we "red line" items so they don't play, can that effect the speed of the macro?

 

Do you know many years ago a programmer said to me, "Bob I don't care how many people check out what I work on, but when I give you a program that's complete, you'll break it every time." I just seem to have a knack with unfortunately, finding things that don't work than that do work. This I apologize for but I feel that many people can benefit that have similar problems that I run into I just seem to find them all at once.

 

Believe me when I tell you Dyslexia does not make it easy when it comes to directions. But I fight the battle...In case your not aware what it is, when normal people read something they interpret it the same as most others, with dyslexia they read and interpret in a mixed up fashion, and some have it worse than others. I am close to normal if there is such a thing, and for the most part can work through the instructions. I mention this because you seemed a little put out in the last response and I totally don't blame you for being put out, cause you have the same problems I have, only in reverse, trying to deal with people that just don't seem to get it.

 

Any-who...Have a great day!

 

Bob

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...
×
×
  • Create New...