Here are the 3 solutions.
1) Let the user select a file on their hard drive (works)
Code:
def oldName = getFile("Which file ?")
2) Copy this file to a subfolder in Images (works)
Code:
def newName = "images/myscript/"+new File(oldName).getName()
new File(newName) << new File(oldName).getBytes()
3) Rename the file to "yourPic" (don't know how!)
Code:
new File(newName).renameTo("images/myscript/yourPic.jpg")
2+3) but simpler
Code:
new File("images/myscript/yourPic.jpg") << new File(oldName).getBytes()
See also an old message