can't close Windows Paint after making changes
Moderators: JRL, Dorian (MJT support)
can't close Windows Paint after making changes
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. ??
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
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.
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.
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
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.If you move the mouse pointer over it, it disappears as well.
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!
Bob
A humble man and PROUD of it!
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
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
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
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:
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:
Perhaps use %window_title% instead of hard coding?
Reviewing and executing the script, I see this:
You have a section where you set focus for Macro Scheduler Message:
But I am getting hung when no such message window exists. So Focus cannot be set.SetFocus>Macro Scheduler Message*
Wait>0.13
PushButton>Macro Scheduler Message*,OK
Wait>0.13
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:
Change To:SetFocus>1x1 kalide - Paint*
WindowAction>3,1x1 kalide - Paint*
Is that why you got the value of window_title earlier in the script?SetFocus>1x1 kalide .bmp - Paint*
WindowAction>3,1x1 kalide .bmp - Paint*
Perhaps use %window_title% instead of hard coding?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
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.
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.
Screen shot at: http://www10.pair.com/vsap/ImgSize_dlg.gifAn 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.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
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
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
re: ImageSize/ attn. Bob Hansen
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.
Thanks.
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
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