Class Tab

Tab

Google Docs 문서 내의 탭입니다.

// Get all of the first-level tabs (tabs that are not nested within a parent
// tab) in the document.
// TODO(developer): Replace the ID with your own.
const tabs = DocumentApp.openById('123abc').getTabs();

// Get a specific tab based on the tab ID.
// TODO(developer): Replace the IDs with your own.
const tab = DocumentApp.openById('123abc').getTab('123abc');

메서드

메서드반환 유형간략한 설명
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()

탭의 유형을 가져옵니다.

asDocumentTab()을 사용하여 더 구체적인 유형으로 변환하기 전에 이 메서드를 사용하여 이 Tab의 콘텐츠 유형을 확인하세요.

const tab = DocumentApp.getActiveDocument().getActiveTab();
// 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