Jump to content
Macro Express Forums

Starman*

Members
  • Posts

    8
  • Joined

  • Last visited

Starman*'s Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Looks like you got forgotten or the experts went fishin' for the weekend. Generally speaking you can only type into the topmost window. I suppose with some applications there may be a way of getting the text in in other ways but it's unlikely. I can only think of a crude way of telling if you have the busy cursor. Let's say at a point +5, +5 pixels from the true cursor position the colours are different for the normal and busy cursors, In a repeat loop: Get mouse position (System) Get pixel colour at mouse position +5, +5 Check colour, busy or normal colour With the standard mouse you could pick a white point close to the actual mouse position that is still within the busy cursor and use if not white = busy I did not try or detail code. Someone has to have a better way!
  2. You can use all sort of things to monitor if a given window is open. I have a generic progress macro that monitors the colour at any part of the screen and gives an audible when there is a change. I only use it for single window monitoring of a single process. In this situation, there could be 10 applications open and the user is switching between any of them, repositioning windows, screensaver, diary reminders etc. There could be a time where there is no window and no dialog box, some file operation is occurring. Your points are valid but it's going to have to be up to Grandziarz to determine what his work habits are and what screen monitoring is acceptable. Using the program running and stopping is by far the best way. Why make life difficult if that option can be made to work? As I mentioned, this is the first application I ever came across where there is apparently no fixed name exe program running the entirety. I use a lot of graphics programs that incorporate other exes, but the main one is always running. Claimpack is a professional package and if I were doing any counting, I would be inclined to log events in a text file with date and number of counts. But that is another story.
  3. Does your macro initiate with Ctrl+H or does it type Ctrl+H as a command? Ctrl+H is already a shortcut in IView.
  4. I'm not sure whether you are talking about starting the program with the macro or shutting it down the macro with the program. To start you basically duplicate whatever shortcut instruction starts the program. Once running you use whatever exe is running during the program. Abc.exe could be the program you initially run. Def.exe could be the program that is running during program execution so you use that (no longer running) to stop the macro. It doesn't really matter what each exe does, all you are using them for is a flag saying the program is running. If the host exe runs without parameters and is running all the time Claimpack is running, then that is what you use. It does not matter what the other one is up to. If one or other program, but not both, are running you add logic such as: if not program abc.exe and if not program def.exe break endif If the windows and dialogs have some commonality it could be something like: if not program abc.exe and if not window (containing) "data form" and if not window (containing) "save data" break endif For windows running you can have a partial title. That does not seem to apply to programs. Do you actually see the parameters in the list of running programs in ME? With all ME programming you've got to be inventive to meet whatever happens. If you run into a roadblock, you have to think what else could I use? If you can't get that working then just use the manual method I detailed in my last post. With that you can manually start Claimpack, start the macro with a hotkey close Claimpack manually and then close the macro/open counter with mouse position + designated key. Below is a fully functional macro that will work regardless of running programs. Modify as you wish. Text Box Display: Instructions Variable Set Integer %N5% to 0 Variable Set String %T3% "notepad on" Variable Set Integer %N11% from Screen Width Variable Set Integer %N12% from Screen Height Variable Modify Integer: %N11% = %N11% - 10 Variable Modify Integer: %N12% = %N12% - 10 Repeat Until %N98% = 1 Get Mouse Position Screen: %N13%, %N14% If Variable %N13% > variable %N11% AND If Variable %N14% > variable %N12% Wait for Key Press: E Break End If If Window Title "Notepad" is running AND If Variable %T3% = "notepad off" Variable Modify Integer: %N5% = %N5% + 1 Variable Set String %T3% "notepad on" End If If Not Window Title "Notepad" running Variable Set String %T3% "notepad off" End If Wait Time Delay 0.5 Seconds Repeat End Text Box Display: Notepad Count <TBOX4:T:1:000372000270000252000145:000:InstructionsStart prior to opening any Notepad windows To stop macro and get count, move mouse to bottom right corner of screen and hit key E.><IVAR2:05:01:0><TVAR2:03:01:notepad on><IVAR2:11:14:><IVAR2:12:15:><NMVAR:02:11:1:0000011:2:0000010><NMVAR:02:12:1:0000012:2:0000010><REP3:08:000001:000002:0098:0:01:1><MOUSEPOS:T:13:14><IFVAR2:5:13:4:N11T><AND><IFVAR2:5:14:4:N12T><WAITKEY2:000010:000000:04><BREAK><ENDIF><IFOTH:04:2:Notepad><AND><IFVAR2:1:03:1:notepad off><NMVAR:01:05:1:0000005:2:0000001><TVAR2:03:01:notepad on><ENDIF><IFOTH:12:2:Notepad><TVAR2:03:01:notepad off><ENDIF><TDELAY:0.5><ENDREP><TBOX4:T:1:000372000270000200000100:000:Notepad CountFinal Count = %N5%> Starman*
  5. I found a crude method of stopping the macro by checking mouse position. Start macro with a hotkey or by Claimpack starting up. To stop macro, put mouse in bottom right corner of screen. I've allowed a margin of 10 pixels, screen size 1024x768. Adjust to suit. To prevent accidental stop you could also add a counter so the mouse has to be there for say 3 counts (1.5 secs) for the Break to work. Alternatively add a "Wait for key press" and set to your choice. Then you would have to have mouse bottom right and then hit the key before the Break would operate. Anyone got better ways of doing this? Substitute for If not program name section (3 lines) Get Mouse Position Screen: %N11%, %N12% If Variable %N11% > 1014 AND If Variable %N12% > 758 Break End If with mouse + key press: Get Mouse Position Screen: %N11%, %N12% If Variable %N11% > 1014 AND If Variable %N12% > 758 Wait for Key Press: E Break End If Starman*
  6. It's not clear what steps you took to check the name of the program. You mention window names. The only item of interest is the program name. Start up your software (not via macro) and look in Task Manager for the program name. You could also use the ME editor - go to the "If not program line" and act as if you're going to change the program. It will give you a list of all running programs. You can either note it or actually change to the running prog. There has to be something running that controls the images. It's not necessarily called claimpack.exe either. Could be something similar. I find it difficult to believe it's a series of different .exe programs. I used the program start because in virtually every case that is the most convenient way to do it. To be really silly, you could start any small program you have (putting that program name in the macro) run Claimpack and it will count the Notepads, when you finish with Claimpack close the other prog to get the count. The problem with this sort of macro is you have to legitimately start and stop. Starting is fine. You could start as I indicated. You cannot just abort the macro when done because then the text box with the count does not appear. If checking the program names detailed above does not work you need to find something else that shows the program has finished. If you start the count macro manuall, there has to be some user interface to turn the thing off to get the count and you don't want a text box popping up every few seconds with the count. That is probably going to be very annoying. I know of other ways of doing it but they involve far too much explanation. I'm not getting into that until the present method solutions have been exhausted. There's a limit to how much time I want to spend. If anyone else wants to chip in, go ahead. Starman*
  7. It's really difficult doing things like this blind. The way I would do this, and there are so many variations, is to start up Claimpack with the macro. In the example I have used I_View (Irfanview) that I have on my pc. Sub your prog name in the two lines it appears. // variables start off as zero (numbers) // or blank (text variables) Variable Set Integer %N5% to 0 Variable Set String %T3% "notepad on" Program Launch: "i_view32.exe" Repeat Until %N98% = 1 If Not Program Name "I_VIEW32.EXE" running Break End If If Window Title "Notepad" is running AND If Variable %T3% = "notepad off" Variable Modify Integer: %N5% = %N5% + 1 Variable Set String %T3% "notepad on" End If If Not Window Title "Notepad" running Variable Set String %T3% "notepad off" End If Wait Time Delay 0.5 Seconds Repeat End Text Box Display: Notepad Count <REM2:variables start off as zero (numbers)><REM2: or blank (text variables)><IVAR2:05:01:0><TVAR2:03:01:notepad on><LAUNCHDEL2:0:01C:\Program Files\IrfanView\i_view32.exe><REP3:08:000001:000002:0098:0:01:1><IFOTH:14:1:I_VIEW32.EXE><BREAK><ENDIF><IFOTH:04:2:Notepad><AND><IFVAR2:1:03:1:notepad off><NMVAR:01:05:1:0000005:2:0000001><TVAR2:03:01:notepad on><ENDIF><IFOTH:12:2:Notepad><TVAR2:03:01:notepad off><ENDIF><TDELAY:0.5><ENDREP><TBOX4:T:1:000372000270000200000100:000:Notepad CountFinal Count = %N5%> The macro starts up your program. The loop checks every 0.5 secs if Notepad is open. For a single opening it would increment every 0.5 secs, which we do not want. T3 makes sure that once an opening is counted, the counter will not increment again until Notepad closes and T3 is set to "notepad off". Next time Notepad opens, the counter N5 will increment. You would have to allow 0.5 secs before opening or closing Notepad. If this is too long, make time delay shorter. The loop continues ad infinitum until you close the main program. The Break command kicks it out of the repeat and displays the count. N98 is never incremented so the loop runs forever T3 is a flag to tell if notepad has been closed N5 is the counter Notes: Instead of the way T3 is done, you could use True and False or set an integer N3 = 0 or 1. I don't normally set my variables at the start to blank or zero but have done for this code. I abbreviated the full title of an unsaved Notepad window "Untitled - Notepad" to "Notepad" in the If Window instruction, fyi Starman*
  8. Without using or even having seen the program it's difficult to be definitive. You could do this by either counting new windows appearing (have a repeat loop that checks the topmost window name and increments a counter each legitimate change) or count the number of times the data entry window/dialog appears. Which would work depends on how the dialog interacts with the image window. If you want more specifics you will have to give an idea of window names (fixed or variable), name of dialog box or whatever you type into.
×
×
  • Create New...