How can an APP close an IMAGE without interaction from the user?
All --
I've investigated several methods to close an intermediate image in an APP including:
-------------
ThisApplication.ActiveImage.Close
-------------
and
-------------
Dim window1
With application.windowcommands.Active(Nothing)
.Run(window1)
End With
With Application.WindowCommands.Close(Nothing)
.Run(window1)
End With
-------------
Unfortunately all of the methods I've tried prompt the USER before the image will close.
Is there a way for an APP to close an image without prompting the user?
Thanks.
-- Matt
I've investigated several methods to close an intermediate image in an APP including:
-------------
ThisApplication.ActiveImage.Close
-------------
and
-------------
Dim window1
With application.windowcommands.Active(Nothing)
.Run(window1)
End With
With Application.WindowCommands.Close(Nothing)
.Run(window1)
End With
-------------
Unfortunately all of the methods I've tried prompt the USER before the image will close.
Is there a way for an APP to close an image without prompting the user?
Thanks.
-- Matt
0
Best Answers
-
Matt,The easiest way is to reset Modified flag before closing the image.
Public Sub CloseModifiedImage() ThisApplication.ActiveImage.Modified=False ThisApplication.ActiveImage.Close End Sub
Yuri0 -
Hi Matt,Now I can see the problem, I tested with filters and the image was closed without prompt. Measurements seem to behave differently. I will check how it can be fixed.For now you can use this macro to close image with measurements without prompt:
Public Function CloseImage3() As SimpleScript CloseImage3 = New SimpleScript With Measure.MeasurementsCommands.DeleteAll(CloseImage3) .Run(ThisApplication.ActiveImage) End With With Adjust.ImageCommands.Close(CloseImage3) .Run(ThisApplication.ActiveImage) End With End Function
Yuri0
Answers
Thank you for the suggestion. I tagged this as ANSWERED before trying your code but . . .
I copied your SUB into my project and then called it at the appropriate place and I still get the prompt before the image closes.
If you have any other suggestions, that would be super.
Perhaps something like
ThisApplication.ActiveImage.CloseNoPrompt
and
Application.Windowcommands.CloseAllNoPrompt
could be added to the IPP9 WISH LIST.
Thanks again.
-- Matt
I've put your
Public Function CloseModifiedImage2
into my project inside IPP904.
My APP calls
CloseModifiedImage2
at the appropriate time and the prompt is still displayed.
-- Matt
Since your
CloseModifiedImage2
is a FUNCTION, I created a SUB to test it.
-----
Public Sub testclosemodifiedimage2()
CloseModifiedImage2
End Sub
-----
When I
-- Start IPP904,
-- Open an image
-- Manually run a bright count on the the image
-- Run testclosemodifiedimage2 from the MACRO EXPLORER
I get a prompt during the close.
-- Matt
I've put your
Public Function CloseImage3
into my APP and it succeeds in closing the current image that has experienced a count without any prompts.
Thanks for looking into this.
-- Matt