can't close Windows Paint after making changes

General Macro Scheduler discussion

Moderators: JRL, Dorian (MJT support)

Post Reply
jalbt51
Junior Coder
Posts: 31
Joined: Sat Mar 06, 2004 4:40 pm

can't close Windows Paint after making changes

Post by jalbt51 » Sat Mar 06, 2004 4:57 pm

After making changes in a windows paint window, Macrosch hangs up and will not go further- the taskbar icon is lit but not flashing. Thus, I cannot program "press tab press enter" to get it to not save the changes. "PushButton" and "Mouseover" are also likewise futile. I think Macrosch is just hanging up here and not allowing any further commands to be executed. ??

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sat Mar 06, 2004 9:48 pm

not flashing.
This means that it is not running. If it was hung up, it would probably still be flashing or yellow. Suggest submitting the code along with the problem so we can resolve this for you.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Lumumba

Post by Lumumba » Sat Mar 06, 2004 11:35 pm

Bob,
well I have one script which runs 24/7, based on a memory leak (?)Macro Scheduler is colapsing (process disappears from the taskmanager), the taskbar icon is still there but not flashing. If you move the mouse pointer over it, it disappears as well.

WinNT/Macro Scheduler 6x

jalbt51: please follow Bob's advise and provide some code. Thx.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sun Mar 07, 2004 6:43 am

If you move the mouse pointer over it, it disappears as well.
I think that is just a matter of timing. I have noticed that if you exit Macro Scheduler that the icon may take a while before it disappears, sometimes waits until the mouse is moved over it. I would suspect that the script probably stopped running (your memory leak?) long before you made the icon disappear. I think the icon sometiimes needs a trigger from the task bar to make it go away.....perhaps some type of bug?... but I have found it a minor curiosity vs. an inconvenience or problem. Never thought it important enough to mention.

Anyway, enuf of that, back to the original problem: jalbt51, where is your script?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

jalbt51
Junior Coder
Posts: 31
Joined: Sat Mar 06, 2004 4:40 pm

Post by jalbt51 » Fri Mar 12, 2004 8:04 pm

This program brings up a 1x1 windows bitmap image, pastes an image already copied onto the clipboard, into the 1x1 window (size doesn't matter), gets the size of the image, pastes each value onto the clip board so that that value can be picked up by "get clipboard" and turned into a variable, and that value is displayed briefly as a message. Then that image is recopied onto the clipboard(the clipboard having been used by the variables). Both the variables d and e, and the image are to be used in another program. the program hangs up when I try to get the window to close without saving the changes. ?? Also, is there a less awkward way of picking up the image size coordinates from the attributes window (alt send i,a)? Here it is


Let>WW_TIMEOUT=10
CapsOff
ExecuteFile>C:\My Documents\0000 Kalide Files\1x1 kalide.bmp
WaitWindowOpen>1x1 kalide - Paint*
Let>MSG_STAYONTOP=1
GetActiveWindow>window_title,X,Y
Message>window_title
Wait>0.23
Press CTRL
Send>v
Wait>0.13
Release CTRL
Wait>0.13
Press ALT
Send>i,a
Wait>0.13
Release ALT
Wait>0.13
Press CTRL
Send>c
Wait>0.13
Release CTRL
Wait>0.13
GetClipBoard>d
Message>d
Wait>0.33
Press Tab
Wait>0.13
Press CTRL
Send>c
Wait>0.13
Release CTRL
Wait>0.13
GetClipBoard>e
Message>e
Wait>0.13
Press Tab*3
Wait>0.13
Press Enter
Wait>0.13
Press CTRL
Send>a,c
Release CTRL
Wait>0.13
SetFocus>Macro Scheduler Message*
Wait>0.13
PushButton>Macro Scheduler Message*,OK
Wait>0.13
Press ALT
Send>o
Wait>0.23
SetFocus>1x1 kalide - Paint*
WindowAction>3,1x1 kalide - Paint*
Wait>0.23
Press CTRL
Wait>0.13
Press Tab
Wait>0.13
Press Enter
Wait>0.13
Release CTRL
Wait>0.23
Press Shift
Press Esc
Release Shift

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Mar 12, 2004 9:33 pm

This is a recorded macro and conditions may be different now. You may be able to remove all of the Wait> lines without a problem.

Reviewing and executing the script, I see this:
You have a section where you set focus for Macro Scheduler Message:
SetFocus>Macro Scheduler Message*
Wait>0.13
PushButton>Macro Scheduler Message*,OK
Wait>0.13
But I am getting hung when no such message window exists. So Focus cannot be set.

What is triggering that Macro Scheduler Message? I can see nothing unless you have another macro running at the same time?

Aha, I found it! The specified window in Paint is 1x1 kalide.bmp - Paint, you need to add the .bmp to the middle of your window references. In a number of lines.

Change From:
SetFocus>1x1 kalide - Paint*
WindowAction>3,1x1 kalide - Paint*
Change To:
SetFocus>1x1 kalide .bmp - Paint*
WindowAction>3,1x1 kalide .bmp - Paint*
Is that why you got the value of window_title earlier in the script?
Perhaps use %window_title% instead of hard coding?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Mar 19, 2004 4:43 pm

Hello jalbt51

I just ran across a utility called ImageSize, freeware available at http://www10.pair.com/vsap/.
This may be the utilityyou need. I have not tried it, so this is not being recommended by me, I am only briinging it to your attention. Would be interested in feedback if you use it.
An Explorer add-on which displays one more page in Properites dialog for graphic files. Very fast and nifty way to get image size, colors count, and more! The formats supported: BMP, PCX, GIF, JPEG, TIFF, PNG.
Screen shot at: http://www10.pair.com/vsap/ImgSize_dlg.gif
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Guest

Post by Guest » Wed Mar 31, 2004 12:57 am

Regarding my attempt to get the size values of a pasted in image, from the attribute window of a windows paint window, I've found that: pasting the image into an IrfanView(http://www.irfanview.com/) window, tabbing my way to its Resize/Resample window, copying each value onto the clipboard and using the GetClipBoard> command to turn each value into a variable works. When the Irfanview window is closed, it just closes without asking whether you want to save the changes- which is handy.

Regarding the many wait commands, windows is very fussy about waiting for the next whatever to come up, perhaps I don't need so many, but I don't know which to eliminate. I think Bob Hansen's comment about timing is on the right track- I've had times when it DOES work.

ExecuteFile requires the name of the file(I get it by bringing up RUN on the start menue, finding the file through browse, bringing that file to the RUN window and copying it.)
SetFocus requies the name of the window found on the Title Bar of the open window. add an * to it just to be safe.
Here it is


Let>WW_TIMEOUT=10
CapsOff
ExecuteFile>C:\Program Files\IrfanView\i_view32.exe
wait>0.20
SetFocus>IrfanView*
wait>0.10
Let>MSG_STAYONTOP=1
Press CTRL
Send>v,r
wait>0.15
Release CTRL
SetFocus>Resize/Resample image*
wait>0.07
Press CTRL
Send>c
Release CTRL
wait>0.10
GetClipBoard>d
wait>0.10
Press Tab
Wait>0.13
Press CTRL
Send>c
Wait>0.13
Release CTRL
Wait>0.13
GetClipBoard>e
Wait>0.13
Press Tab*8
Wait>0.13
Press Enter
Wait>0.13
Press CTRL
Send>c
Release CTRL
CloseWindow>IrfanView*
Wait>0.13
Press Shift
Press Esc
Release Shift

jalbt51
Junior Coder
Posts: 31
Joined: Sat Mar 06, 2004 4:40 pm

re: ImageSize/ attn. Bob Hansen

Post by jalbt51 » Wed Mar 31, 2004 7:58 pm

Image size seems to be a neat little tool, but to use it I have to right click the icon of the file whose characteristics I want to examine. Does anyone know how to duplicate the effect of right clicking a file's icon without actally opening the window and positioning the cursor over it?
Thanks.

Lumumba

Post by Lumumba » Wed Mar 31, 2004 9:46 pm

Well you've to select the file you wanna work with. It makes no difference if done using the mouse or via the keyboard (eg. TAB ing).

If the file has been selected use the Windows Context Menu Key on your keyboard (should be beside the Windows key on the right).
Its Macro Scheduler command: Press MenuKey

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts