Jump to content
Macro Express Forums

Not Found


Amerifax-Bob
 Share

Recommended Posts

I'm searching for text using any text editor. If text is found it will close search box and highlight the result. Perfect!

 

If not found a box comes up "Not Found". that's the problem. My macro hangs up on the open box, which can be closed with "esc" "esc".

 

When the text is properly high lighted the macro does a:

1. Copy to clipboard

2. creates a variable

 

My problem is how to have the macro deal with the "Not Found" box and continue on. The perfect solution would be a variable with "not Found" or a variable with the searched item.

 

I'm now actually looking for a text editor that can work with my Macro that will not hang up with "Not Found" but instead will go back to the text document inserting the word "Not Found". So I either need a cure for my problem with Macro Express or a miracle Text Editor.

 

Bob

Link to comment
Share on other sites

I don’t know exactly what kind of editor you’re using but you might consider using an If Window On Top with the condition equal to the title of the error dialog box. After issuing the find command put in a delay of 100mS or more for good measure though. If that doesn't work you might consider using control conditions instead. EG If Control C1 = "Not Found".

Link to comment
Share on other sites

I'm not doing to good with the if statement. The following will not create a variable when "If Window Title "UltraEdit" is on top" is true. I have to Esc Esc out and continue after the endif. But when false it needs to run the "else" and continue after the "endif".

 

// T10 County

Text Type: <ALT><F3>County:<ENTER>

Delay 200 Milliseconds

If Window Title "UltraEdit" is on top

Text Type: <ESC><ESC>

Else

Text Type: <ARROW RIGHT><SHIFT><END>

Clipboard Copy

Variable Set String %T10% from Clipboard

End If

 

What is happing is no vaiable. But if I do the following It works:

 

// T10 County

Text Type: <ALT><F3>County:<ENTER>

Delay 200 Milliseconds

If Window Title "UltraEdit" is on top

Text Type: <ESC><ESC>

endif

Text Type: <ARROW RIGHT><SHIFT><END>

Clipboard Copy

Variable Set String %T10% from Clipboard

 

Problem with this is if "If Window Title "UltraEdit" is on top" is true I get a false value.

 

Bob

Link to comment
Share on other sites

I don't have a lot of time to consider your problem in great detail but I did a quick test in my UltraEdit. Apparently both the editor and the dialog box that reports "Search string not found" are titled the same, in my case "UltraEdit-32". This being the case if the error box didn't appear then the editor would be on top but it too has the same name. Had the dialog box title been "UltraEdit-32 Error" this approach would work but in this case, no.

 

If it were me I would use the error message as a control. SO set Ci to be the Error box string of text "Search string not found" using the text method. Now use a If Control Visible for your condition.

Link to comment
Share on other sites

Another thing... In cases like this I do not actually open the file. What I do is to load the file into a text var and use Get Position to find the integer position of the search text. Then I offset it and Copy Part of Text to set my variable. It's super fast, doesn't have timing errors, and is way simpler than dealing with the GUI.

Link to comment
Share on other sites

C1 (that's a one) are control variables. The use of controls is a littl more advanced but well worth the study. Check out the tutorials in the sample file or on the website. They're pretty fun.

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