Skip to content

Instantly share code, notes, and snippets.

@Hamcha
Forked from anonymous/folders.gs
Last active August 16, 2016 21:15
Show Gist options
  • Save Hamcha/7d8478528610b6520be030fc7399b8ee to your computer and use it in GitHub Desktop.
Save Hamcha/7d8478528610b6520be030fc7399b8ee to your computer and use it in GitHub Desktop.
var folders = DriveApp.getFoldersByName("Università");
var subfolder = null;
if (folders.hasNext()) {
var folder = folders.next();
var subfolders = folder.getFoldersByName("Sbobine");
if (subfolders.hasNext()) {
var folder = subfolders.next();
var subsubfolders = folder.getFoldersByName("5o Anno");
if (subsubfolders.hasNext()) {
var folder = subsubfolders.next();
var materiafolder = folder.getFoldersByName(form.materia);
subfolder = materiafolder.hasNext() ? materiafolder.next() : folder.createFolder(form.materia);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment