app/api/external/google/drive/example/script.js
function listFiles() {
	gapi.client.drive.files.list({
		'pageSize': 10,
		'fields': "nextPageToken, files(id, name)"
	}).then(function(response) {
		appendPre('Files:');
		var files = response.result.files;
		if (files && files.length > 0) {
			for (var i = 0; i < files.length; i++) {
				var file = files[i];
				appendPre(file.name + ' (' + file.id + ')');
			}
		} else {
			appendPre('No files found.');
		}
	});
}
function listFiles() {
	gapi.client.drive.files.list({
		'pageSize': 10,
		'fields': "nextPageToken, files(id, name)"
	}).then(function(response) {
		appendPre('Files:');
		var files = response.result.files;
		if (files && files.length > 0) {
			for (var i = 0; i < files.length; i++) {
				var file = files[i];
				appendPre(file.name + ' (' + file.id + ')');
			}
		} else {
			appendPre('No files found.');
		}
	});
}
function listFiles ( ) { gapi . client . drive . files . list ( { 'pageSize' : 10 , 'fields' : "nextPageToken, files(id, name)" } ) . then ( function ( response ) { appendPre ( 'Files:' ) ; var files = response . result . files ; if ( files && files . length > 0 ) { for ( var i = 0 ; i < files . length ; i ++ ) { var file = files [ i ] ; appendPre ( file . name + ' (' + file . id + ')' ) ; } } else { appendPre ( 'No files found.' ) ; } } ) ; }
Print files.
Print files .