Is there a way to execute saveDialog, silently , meaning, not asking the user to specify file name?
Its intended for existing code automation. lets assume we cannot use different saveDialog Object.
Is there a way to execute saveDialog, silently , meaning, not asking the user to specify file name?
Its intended for existing code automation. lets assume we cannot use different saveDialog Object.
Well, the only purpose the SaveDialog has is providing a file name, so the obvious short anser is: do not use the SaveDialog.
But if you want to take all the options of the SaveDialog into account, then you have to do some checking yourself before saving the file. The non-visual options that apply, and the key routines that are involved for handling those options are:
ofPathMustExist
: if False, then useForceDirectories
ofFileMustExist
: if True, then useFileExists
ofNoReadOnlyReturn
: if True, then useFileIsReadOnly
ofNoDereferenceLinks
: use it, inverted, as the FollowLink parameter in FileExists.All other applicable options (
ofOverwritePrompt
= True,ofPathMustExist
= True,ofNoTestFileCreate
= False) are matched by using a try - except block around the saving of the file.