I was delighted to find Amit Agarwal's script in Moving Files In Google Drive Using Google Script, that allows one to move a file from one folder to another on Google Drive.
function moveFiles(sourceFileId, targetFolderId) {
var file = DriveApp.getFileById(sourceFileId);
DriveApp.getFolderById(targetFolderId).addFile(file);
file.getParents().next().removeFile(file);
}
How could this be modified to select only files of a specific type, say PDFs?