Class Link

링크

하이퍼텍스트 링크입니다.

메서드

메서드반환 유형간략한 설명
getLinkType()LinkTypeLinkType를 반환합니다.
getLinkedSlide()Slide|nullURL이 아닌 링크 유형의 연결된 Slide를 반환합니다(있는 경우).
getSlideId()String|nullLinkTypeLinkType.SLIDE_ID이 아닌 경우 연결된 Slide 또는 null의 ID를 반환합니다.
getSlideIndex()Integer|nullLinkTypeLinkType.SLIDE_INDEX이 아닌 경우 연결된 Slide 또는 null의 0 기반 색인을 반환합니다.
getSlidePosition()SlidePosition|nullLinkTypeLinkType.SLIDE_POSITION이 아닌 경우 연결된 Slide 또는 nullSlidePosition을 반환합니다.
getUrl()String|nullLinkTypeLinkType.URL이 아닌 경우 외부 웹페이지의 URL 또는 null를 반환합니다.

자세한 문서

getLinkType()

LinkType를 반환합니다.

const shape = SlidesApp.getActivePresentation().getSlides()[0].getShapes()[0];
const link = shape.getLink();
if (link != null) {
  Logger.log(`Shape has a link of type: ${link.getLinkType()}`);
}

리턴

LinkType

승인

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

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

getLinkedSlide()

URL이 아닌 링크 유형의 연결된 Slide를 반환합니다(있는 경우). 슬라이드가 프레젠테이션에 없거나 LinkTypeLinkType.URL이면 null를 반환합니다.

const shape = SlidesApp.getActivePresentation().getSlides()[0].getShapes()[0];
const link = shape.getLink();
if (link != null && link.getLinkType() !== SlidesApp.LinkType.URL) {
  Logger.log(`Shape has link to slide: ${link.getLinkedSlide()}`);
}

리턴

Slide|null

승인

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

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

getSlideId()

LinkTypeLinkType.SLIDE_ID이 아닌 경우 연결된 Slide 또는 null의 ID를 반환합니다.

반환된 ID의 슬라이드가 없을 수도 있습니다.

const shape = SlidesApp.getActivePresentation().getSlides()[0].getShapes()[0];
const link = shape.getLink();
if (link != null && link.getLinkType() === SlidesApp.LinkType.SLIDE_ID) {
  Logger.log(`Shape has link to slide with ID: ${link.getSlideId()}`);
}

리턴

String|null

승인

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

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

getSlideIndex()

LinkTypeLinkType.SLIDE_INDEX이 아닌 경우 연결된 Slide 또는 null의 0 기반 색인을 반환합니다.

반환된 색인의 슬라이드가 없을 수도 있습니다.

const shape = SlidesApp.getActivePresentation().getSlides()[0].getShapes()[0];
const link = shape.getLink();
if (link != null && link.getLinkType() === SlidesApp.LinkType.SLIDE_INDEX) {
  Logger.log(`Shape has link to slide with index: ${link.getSlideIndex()}`);
}

리턴

Integer|null

승인

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

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

getSlidePosition()

LinkTypeLinkType.SLIDE_POSITION이 아닌 경우 연결된 Slide 또는 nullSlidePosition을 반환합니다.

반환된 상대 위치가 있는 슬라이드가 없을 수도 있습니다.

const shape = SlidesApp.getActivePresentation().getSlides()[0].getShapes()[0];
const link = shape.getLink();
if (link != null && link.getLinkType() === SlidesApp.LinkType.SLIDE_POSITION) {
  Logger.log(
      `Shape has link to slide with relative position: ${
          link.getSlidePosition()}`,
  );
}

리턴

SlidePosition|null

승인

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

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

getUrl()

LinkTypeLinkType.URL이 아닌 경우 외부 웹페이지의 URL 또는 null를 반환합니다.

const shape = SlidesApp.getActivePresentation().getSlides()[0].getShapes()[0];
const link = shape.getLink();
if (link != null && link.getLinkType() === SlidesApp.LinkType.URL) {
  Logger.log(`Shape has link to URL: ${link.getUrl()}`);
}

리턴

String|null

승인

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

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