When I run the saved code, the saved file type is always PSD and cannot be changed. Is there any good way to solve it? I want to save as the specified type.
May I ask where did you find this code example? In the docs I find getFileForSaving() accepts only one argument (you provide two) and save() does not accept any at all (you provide also two)
I think that’s for Ps v22. Here’s for v23
Sorry, I personally didn’t have to deal with document save myself, just noticed, that methods are used differently from what docs say