Class Tab

Tab

Google Docs 문서 내의 탭.

// Get all of the first-level tabs (tabs that are not nested within a parent tab) in the
// document.
var tabs = DocumentApp.openById('abc123456').getTabs();

// Get a specific tab based on the tab ID.
var tab = DocumentApp.openById('abc123456').getTab('t.0');

메서드

메서드반환 유형간략한 설명
asDocumentTab()DocumentTab탭 콘텐츠를 DocumentTab로 검색합니다.
getChildTabs()Tab[]이 탭 내에 중첩된 하위 탭을 검색합니다.
getId()String탭의 ID를 검색합니다.
getIndex()Integer상위 요소 내에서 탭의 0부터 시작하는 색인을 검색합니다.
getTitle()String탭의 제목을 검색합니다.
getType()TabType탭 유형을 검색합니다.

자세한 문서

asDocumentTab()

탭 콘텐츠를 DocumentTab로 검색합니다.

리턴

DocumentTab: DocumentTab인 탭입니다.


getChildTabs()

이 탭 내에 중첩된 하위 탭을 검색합니다.

리턴

Tab[] - 이 탭 내에 중첩된 하위 탭입니다.

승인

이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상으로 승인이 필요합니다.

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getId()

탭의 ID를 검색합니다.

리턴

String - 탭의 ID입니다.

승인

이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상으로 승인이 필요합니다.

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getIndex()

상위 요소 내에서 탭의 0부터 시작하는 색인을 검색합니다.

리턴

Integer - 상위 탭 내 탭의 색인입니다.

승인

이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상으로 승인이 필요합니다.

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getTitle()

탭의 제목을 검색합니다.

리턴

String - 탭 제목입니다.

승인

이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상으로 승인이 필요합니다.

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getType()

탭 유형을 검색합니다.

더 많은 기기로 전송하기 전에 이 메서드를 사용하여 이 Tab의 콘텐츠 유형을 확인하세요. asDocumentTab()을 사용하여 특정 유형을 지정할 수 있습니다.

var tab = DocumentApp.getActiveDocument().getTab('t.0');
// Use getType() to determine the tab's type before casting.
if (tab.getType() == DocumentApp.TabType.DOCUMENT_TAB) {
  // It's a document tab, write some text to it.
  tab.asDocumentTab().setText('Hello World!');
} else {
 // There are currently no types other than DOCUMENT_TAB.
}

리턴

TabType - 탭 유형입니다.

승인

이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상으로 승인이 필요합니다.

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents