Jump to content
Macro Express Forums

Puzzling behaviour


terrypin

Recommended Posts

This has had me puzzled for a while so I wonder if someone can explain it please. As part of another exercise, I'm experimenting with the following very trivial macro, which simply activates Notepad, maximises it, and pops up a message.

 

// Activate NotePad (already running)
Activate Window: "Notepad"
Wait For Window Title: "Notepad"
Window Maximize: "Notepad"
Text Box Display: 
Macro Return

 

The actual code is:

 

<REM2:Activate NotePad (already running)><ACTIVATE2:Notepad><WAITWIN2:000010:000000:Notepad><WMAX:Notepad><TBOX4:T:4:CenterCenter000278000200:005:Notepad has been opened and maximised><MRETURN>

 

Note how I've entered just the partial name 'Notepad', not the full name 'Untitled - Notepad'. Now, if I run that from the script editor it fails to work properly. The message pops up OK, but Notepad has not been maximised. Yet if I change that command to

Window Maximize: "Untitled - Notepad"

it does work correctly. And if I activate from a hotkey instead of from the Scripting editor, either version works fine.

 

Is there some obscure/undocumented issue at work here please?

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

I copied your Direct Editor code into my ME, and it runs fine, doing what it's supposed to, whether I run it from a

hotkey, shortkey or the Play button on the Scripting Editor window.

 

I'm running ME version 3.7a build 1, 3.7.1.1 on this computer.

 

My comp at home is running 3.7d, but I can't check that one right now. This may be an issue for the Insight folks.

Link to comment
Share on other sites

Either make sure the nickname (title) of the macro does not include 'Notepad' or change the macro to use ' - Notepad'.
Activate Window: " - Notepad"
Wait For Window Title: " - Notepad"
Window Maximize: " - Notepad"

 

Thanks Kevin. But can you explain that please? Why does that work? Why not just 'Notepad'?

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

I know you asked Kevin, but since I just happen to be monitoring the board right now (got a problem of my own), I thought I'd

answer. When you are running the macro with the script editor open, the title of the macro is in the title bar of macro express. So

when you run the macro with only "Activate Window: "notepad", the macro sees that "notepad" is the top window and doesn't

bother doing anything.

 

I don't want to upset anybody by continuing my problem in this thread, when I've got one open, but if you happen to know the answer to

my problem and can post it to the other thread (about the Web Site Command), I would be very happy!

Link to comment
Share on other sites

I know you asked Kevin, but since I just happen to be monitoring the board right now (got a problem of my own), I thought I'd

answer. When you are running the macro with the script editor open, the title of the macro is in the title bar of macro express. So

when you run the macro with only "Activate Window: "notepad", the macro sees that "notepad" is the top window and doesn't

bother doing anything.

 

I don't want to upset anybody by continuing my problem in this thread, when I've got one open, but if you happen to know the answer to

my problem and can post it to the other thread (about the Web Site Command), I would be very happy!

 

Thanks, Scasper, understood.

 

See my reply in your other thread, FWIW.

 

--

Terry, East Grinstead, UK

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