Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
'Styles' hot keys. QM 'loses it': "window not found"
#1
Hi,

I have come back to using QuickMacros are a long break. This tiem I ma hoping you can help me solve a problem that was slowing me down a lot. Maybe I didn't try hard enough last time to ask...

I am a technical writer and my prime use of QM is for giving me hot key shortcuts to formatting styles in applications that don't provide shortcut keys. E.g, MS Word is excellent at shortcut keys, but I also work with FrameMaker and RoboHelp, neither of which offer a full style shortcuts mapping feature.

The QM shortcut that I make works for a while, but then it just seems to lose the position of the Styles window, and tells me "window not found".

So what happens when I use QM with RoboHelp is like this:

1. I first select a word in the RoboHelp text screen that I want to apply a style to.

2. I start the macro recording session, and the 'QM recording' window appears in the lower right corner of my screen.

3. I click the mouse on RoboHelp's Styles drop down box. I am careful to click on the current style name appearing in that box, and so then it is selected (highlighted).

4. I type in the full name of the style I want.

5. I press Enter on the keyboard.

6. I conclude the macro recording session by clicking on the Repl. button from the 'QM recording' window.

A typical macro I get is:

Code:
Copy      Help
int w1=act(win("RoboHelp HTML - CO UI API PG - [Changing the views settings *]" "Afx:00480000:8:00010011:00000000:*""" 0x800))
lef 64 88 w1
'SheadingV3Y

So as you see, the name of the style I have entered is 'heading 3'

7. I apply a hot key combination

8. I try using my macro. usually it works. If not , then it is because the end of the first line of my new macro somehow got an extra closing bracket ( ")" ), like this:

int w1=act(win("RoboHelp HTML - CO UI API PG - [91]3 - Writing a simple CollectionOrganizerUI program]" "Afx:00480000:8:00010011:00000000:*" "" 0x800)))

And after that it works (usually).

But only for a while … and then it stops working.

In the QM message window at the bottom, QM tells me "window not found".

So first of all I used to think that this is because at some point I moved the RoboHelp window's position on the screen, so now QM just simply lost the position of the Styles list box. But I know that I have not moved RoboHelp at all.

So I have two questions:

1. Why does QM tells me "window not found", i.e., why does QM apparently lose the position of my Styles drop down listbox?

2. Is there anyway that I can be a bit more clever, and get the actual Windows name or Windows ID of the
Styles drop down listbox, and then hopefully I will just bypass the problem?

I seem to remember that I used QM when I worked with a different help authoring platform, called Fasthelp, and as far as I
remember it worked great, and I think I noticed that QM recorded the GUI ID of the Styles window.

Funny thing - I also tried mapping hot keys with some competitor tool to QM, adn I got the same sort of problem.

If I can get this working, I will buy QM for all my clients (I am a freelancer).

TIA

- avi
#2
Usually the reason is changed window name or class name. Are you sure that they are the same as when recording?

For example, when you record, there is * in window name (ie the document is not saved), and it disappears when saved. In macro, remove the window name parts that change.
If changes class name, in macro replace that class name part with * and use flag 0x800.
#3
Aha!

Now you are on to something. This does happen.
when you load a new project into RoboHelp, the title shows the new project name.
Not only that, when you are editing a new topic, it also adds the name of the topic to the title.
Actually, Visual Studio does something like this also.

That's it!!!! I just took out all the Window ID stuff and left it as act(Win) and now it works for every window.

Thanks!

avi


Forum Jump:


Users browsing this thread: 1 Guest(s)