johnlindquist / kit

Script Kit. Automate Anything.
https://scriptkit.com
MIT License
3.91k stars 138 forks source link

Don't show "Create File" option in `path` utility when `onlyDirs` is set #1463

Closed JosXa closed 5 months ago

JosXa commented 6 months ago

(1) Not sure if I also need to do this in terminal.ts? Nah, it just redirects to arg

(2) I also noticed that you can't pass a filename to the startPath, but I'm not sure how exactly to fix it because I'm making these changes blindly without being able to test them out. The createPathChoices function has multiple uses, so I'm not certain I can just modify its startPath parameter inside or if I should do it at the call sites. Do you have some pointers? Then I'd include that in the PR.

(3) It seems I can create a folder when entering a file with extension (try test.txt). This might be intended in some circumstances, but I'd argue creating a folder with a dot is rare enough that we should forbid it. Opinions?