Close all images w/o the user prompt
Hi guys,
I found some examples about how to close all the open images without the user prompt.
I have used some of them on my macro but I still have the user prompt dialog.
here my code:
thank you
Maurizio
I found some examples about how to close all the open images without the user prompt.
I have used some of them on my macro but I still have the user prompt dialog.
here my code:
With MediaCy.Automation.Application.ApplicationCommands.SetOption(Nothing)
.Section = "Images"
.Key = "PromptBeforeClosing"
.Value = False
.Run()
End With
With MediaCy.Automation.Application.WindowCommands.CloseAll(Nothing)
.ShowPrompt=False
.Run()
End With
where is the mistake?thank you
Maurizio
0
Answers
-
Hi Maurizio,
You can close all images without prompt using this macro:Public Function Macro1() As SimpleScript Macro1 = New SimpleScript With Application.WindowCommands.CloseAll(Macro1) .Run() End With End Function
You can find other ways to do that in this post:
http://forums.mediacy.com/discussion/comment/604/#Comment_604
Regards,
Yuri0 -
Hi Yuri,
I already tried, it doesn't work.
this is what happens regardless the code I use.
Recently I have installed the last Hot Fix patch
ciao
Maurizio
0 -
Hi Maurizio,
Next macros should close all images without prompt:Public Function CloseAllImagesWithoutPrompt() As SimpleScript CloseAllImagesWithoutPrompt = New SimpleScript With Application.ApplicationCommands.SetOption(CloseAllImagesWithoutPrompt) .Section = "Images" .Key = "PromptBeforeClosing" .Value = False .Run() End With With Application.WindowCommands.CloseAll(CloseAllImagesWithoutPrompt) .Run() End With With Application.ApplicationCommands.SetOption(CloseAllImagesWithoutPrompt) .Section = "Images" .Key = "PromptBeforeClosing" .Value = True .Run() End With End Function Public Function CloseAllImagesWithoutPrompt2() As SimpleScript CloseAllImagesWithoutPrompt2 = New SimpleScript With Automate.ScriptingCommands.CodeCommand(CloseAllImagesWithoutPrompt2) If .Run() Then ' User Code Here ThisApplication.WindowsEx.CloseAll(True) End If End With End Function
Thanks,
Nikita.
0 -
Hi Maurizio,
My macro should also work, I just tested.
Note, that you must use SimpleScript name as CloseAll parameter (Macro1):Public Function Macro1() As SimpleScript Macro1 = New SimpleScript With Application.WindowCommands.CloseAll(Macro1) .Run() End With End Function
If the name is wrong or Nothing, it will show prompt:With Application.WindowCommands.CloseAll(Nothing) .Run() End With
Yuri0 -
Let me turn my request in this way, How can I close all the open images from an APP (not using a macro)?
Thank you
Maurizio0 -
Hi Maurizio,
If you have an app, just copy my code to your app (you may use full namespace to avoid conflicts), e.g. to AnsaldoGPT2_module.vb:Public Function Macro1() As SimpleScript Macro1 = New SimpleScript With Mediacy.Automation.Application.WindowCommands.CloseAll(Macro1) .Run() End With End Function
And then call Macro1 from your app (e.g. from event handler), something like this:Private Sub DCReset_Cmd_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles DCReset_Cmd.Click AnsaldoGPT2_module.Macro1
Yuri
0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions