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
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,
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
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.
My macro should also work, I just tested.
Note, that you must use SimpleScript name as CloseAll parameter (Macro1):
If the name is wrong or Nothing, it will show prompt:
With Application.WindowCommands.CloseAll(Nothing) .Run() End With
Yuri
Thank you
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:
Yuri