In addition: I posted a longer and more capable script for the same task later:
Note that instead of using move, you might want to use import since move is currently not working as expected in JXA.
And you can, as @Blanc correctly said, do the same things in Applescript.
1 Like