Jump to content
Macro Express Forums

Script Error-Window could not be opened


Recommended Posts

I'm able to execute my program, go into it and use it and then close it. When I close there was an error message underneath it:
Script Error
The following error was encountered:
Windows could not be found
Macro Name: CintaNotes-Open
Line Number: 1

 

Here is a sample of the code from Direct Editor:
<ACTIVATE OR LAUNCH Title="Activate or Launch" Exact_Match="FALSE" Wildcards="FALSE" Path="A:\\PRG\\Notes\\CintaNotes\\CintaNotes.exe" Mode="\x00" Default_Path="FALSE" Wait="1"

 

Not a clue why.

Bob
 

Link to comment
Share on other sites

Yes. I can actually click on CintaNotes in this directory and execute. I can also past it into WIn+R and also execute. In Activate or Launch\Advanced\Program/Path name:

A:\PRG\Notes\CintaNotes\CintaNotes.exe

Also activates. Here is the macro I'm using:

Activate or Launch

Options

Select the window command: Activate the window if it exists, otherwise launch the program

Window Title: Activate or Launch

Partial Match

 

Activate or Launch

Program-Program

Program/name: A:\PRG\Notes\CintaNotes\CintaNotes.exe

Run Mode: Normal

 

Scope

Window Title: CintaNotes

The window must be on top (which it is)

The title is a partial match

Do not include hidden windows

Program Name: A:\PRG\Notes\CintaNotes\CintaNotes.exe

The program must be on top

 

I also going to CintaNotes to make sure the options are set to be friendly with MEP

Options\Windows\Always on Top & Minimize to system tray and Close to system tray are turned off.

 

But, when I run debug in the Macro Express Pro Script Editor I get the following error message:
On Error:  Window could not be following (0X0006)

 

Activate or Launch

This when I debug

 

My Results when I execute the macro, Using, Run Macro Now

Strange as it seems:

It does allow CintaNotes  to load, allowing me to open and close notes. When I exit CintaNotes that's when I see the error the message box, as I listed in my original message.

Bob

 

 

Link to comment
Share on other sites

In regards to the A Drive, I have been using both A & B Drive's for about 10 years or more. I try to put as little as I can on the C drive for backup purposes. The A drive holds most of my valued data while the B drive wholes my temporary backups.

A for Actual valued data

B for BK Backup files before they are moved to the X drive which is the final resting place for my backups. At least until moved to an external drive .

Not too original but to each their own I guess, right.

Bob

Link to comment
Share on other sites

Ever since floppies went out of style I've used my A and B letters. I will always make my OS drive C because eventually I'll find someone who assumes that the OS drive is C in their software, but my main data drive is A. Why would you want to forsake A and B? 

Bob you might try running MEP with admin privileges. 

In a few cases I've had to resort to using TaskKill. You might want to check it out.  I hope you get MEP to work first, but in the event it doesn't this works well. 

Link to comment
Share on other sites

If you are active in the application, have you considered closing it by using it's commands? 

Or have you considered using the Windows keyboard shortcut Alt+F4. That is the same as clicking the X in the upper right of a WinForm. 

Link to comment
Share on other sites

  • 2 weeks later...

Hi all,

I am stuck hope someone can help me please.

This is my Macro to close a search control:

<WAIT FOR CONTROL Control="%Error1%" Option="\x06" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<IF CONTROL Option="\x06" Variable="%Suche ergebnislos%"/>
<GET CONTROL Flags="0" Program_Name="EXCEL.EXE" Class="#32770" Title="Microsoft Excel" Control="\"OK\",\"Button\"" Variable="%Suche ergebnislos%" Caption="Microsoft Excel" Partial="FALSE" Wildcards="FALSE"/>
<SET FOCUS Control="%Suche ergebnislos%"/>
<TEXT TYPE Action="0" Text="<ESC>"/>
<TEXT TYPE Action="0" Text="<ESC>"/>
<END IF _COMMENT="1"/>
Once the control is focused it closes the Control, the problem I have got is that once the control is not displayed I get the error control does not exist.

 

No matter what I have tried I cant seem to catch that error message.

 

What would be the correct way to capture the error message "Control does not exist" please.

 

Kind regards

Hans Peter Betzler

Link to comment
Share on other sites

  • 4 weeks later...

Hans I suggest in the future you create a new post for a new topic.

 

As I recently explained, all commands that have a potential for failing should use the "Catch Error" commands. Whatever exception can be thrown by a command can be handled here without crashing the program. 

But you should also be putting to condition existence in a logic block. If Control Exists, Else. 

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