북마크를 나타내는 객체입니다.
const doc = DocumentApp.getActiveDocument(); const documentTab = doc.getActiveTab().asDocumentTab(); // Insert a bookmark at the cursor position (in the active tab) and log its ID. const cursor = doc.getCursor(); const bookmark = documentTab.addBookmark(cursor); Logger.log(bookmark.getId());
메서드
| 메서드 | 반환 유형 | 간략한 설명 |
|---|---|---|
get | String | Bookmark의 ID를 가져옵니다. |
get | Position | Document 내에서 Bookmark의 Position를 가져옵니다. |
remove() | void | Bookmark를 삭제합니다. |
자세한 문서
get Id()
Bookmark의 ID를 가져옵니다. ID는 Document 내에서 고유합니다.
리턴
String: Document 내에서 고유한 Bookmark의 ID입니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
get Position()
Document 내에서 Bookmark의 Position를 가져옵니다. 스크립트가 문서 구조를 변경하더라도 Bookmark가 삭제되지 않는 한 Position는 정확하게 유지됩니다.
리턴
Position: Bookmark의 위치입니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
remove()
Bookmark를 삭제합니다. 이미 삭제된 Bookmark에서 이 메서드를 호출해도 아무런 효과가 없습니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents