Closed pklaschka closed 2 years ago
(There are also a few similar issues with the other functions, including, but not limited to, a syntax error in the getFileForOpening
which, e.g., also includes the code example syntax error; getFileForSasving
is just something I recently used and therefore took a closer look at)
Expected Behaviour
In
uxp/src/pages/uxp/reference-js/Modules/uxp/Persistent File Storage/FileSystemProvider.md
, the documentation should reflect the APIs behavior, which (tested in both PS and XD in their current versions) differs between docs and actual behavior. The old XD docs actually document the correct behavior.What the docs should look like (based on the actual behavior)
## getFileForSaving(suggestedName, options) Gets a file reference suitable for read-write by displaying a "Save" file picker dialog to the user. If the act of writing to the file would overwrite it, the file picker will prompt the user to confirm before returning a result to you. **Returns**: `PromiseActual Behaviour
Issues with the current documentation:
suggestedName
argument is not mentioned at all, but is required (also in the code example)File
, but there's no mention that the function isasync
=> it would probably be the easiest to document the return type asPromise<File>
.=
has to be:
in theoptions
object)=> Overall, without looking back at adobexdplatform.com (or my old code based on the info from there), there would have been no way for me to discover the actual working solution from either the docs or anywhere else (there's also no way to discover correct arguments via dev tools, etc., after all, meaning the only option would have been a lot of trial and error).
Reproduce Scenario (including but not limited to)
Steps to Reproduce
Platform and Version
(both Windows 10)
Sample Code that illustrates the problem
Logs taken while reproducing the problem
n/a