북마크를 나타내는 객체입니다.
// Insert a bookmark at the cursor position and log its ID. var doc = DocumentApp.getActiveDocument(); var cursor = doc.getCursor(); var bookmark = doc.addBookmark(cursor); Logger.log(bookmark.getId());
방법
메서드 | 반환 유형 | 간략한 설명 |
---|---|---|
getId() | String | Bookmark 의 ID를 가져옵니다. |
getPosition() | Position | Document 내에서 Bookmark 의 Position 를 가져옵니다. |
remove() | void | Bookmark 를 삭제합니다. |
자세한 문서
getId()
Bookmark
의 ID를 가져옵니다. ID는 문서 내에서 고유합니다.
리턴
String
: Bookmark
의 ID로, 문서 내에서 고유합니다.
승인
이 방법을 사용하는 스크립트는 다음 범위 중 하나 이상을 승인해야 합니다.
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getPosition()
remove()
Bookmark
를 삭제합니다. 이미 삭제된 Bookmark
에서 이 메서드를 호출해도 효과가 없습니다.
승인
이 방법을 사용하는 스크립트는 다음 범위 중 하나 이상을 승인해야 합니다.
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents