Class FolderIterator
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
FolderIterator
אובייקט שמאפשר לסקריפטים לבצע איטרציה על אוסף גדול של תיקיות. אפשר לגשת לאיטרטורים של תיקיות מ-DriveApp, מ-File או מ-Folder.
// Log the name of every folder in the user's Drive.constfolders=DriveApp.getFolders();while(folders.hasNext()){constfolder=folders.next();Logger.log(folder.getName());}
מקבלים טוקן שאפשר להשתמש בו כדי להמשיך את האיטרציה הזו מאוחר יותר. השיטה הזו שימושית אם העיבוד של איטרטור בהפעלה אחת חורג ממשך ההפעלה המקסימלי. אסימוני המשך תקפים בדרך כלל למשך שבוע.
חזרה
String – טוקן המשך שאפשר להשתמש בו כדי להמשיך את האיטרציה הזו עם הפריטים שנשארו באיטרטור כשהטוקן נוצר.
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2026-03-06 (שעון UTC)."],[],["FolderIterator allows iterating over a large collection of folders. Key actions include using `hasNext()` to check for the next item and `next()` to retrieve it. `getContinuationToken()` provides a token to resume iteration later, helpful for large collections. The example shows how to log every folder's name in a user's Drive, demonstrating iteration through the folder collection. The iterator returns folder objects and can throw an exception if no items remain.\n"]]