Class Link

Bağlantı

Bir köprü.

Yöntemler

YöntemDönüş türüKısa açıklama
getLinkType()LinkTypeLinkType değerini döndürür.
getLinkedSlide()Slide|nullURL olmayan bağlantı türleri için varsa bağlı Slide öğesini döndürür.
getSlideId()String|nullLinkType, LinkType.SLIDE_ID değilse bağlı Slide veya null öğesinin kimliğini döndürür.
getSlideIndex()Integer|nullLinkType, LinkType.SLIDE_INDEX değilse bağlı Slide veya null öğesinin sıfır tabanlı dizinini döndürür.
getSlidePosition()SlidePosition|nullBağlı SlidePosition öğesinin Slide değerini veya LinkType değeri LinkType.SLIDE_POSITION değilse null değerini döndürür.
getUrl()String|nullHarici web sayfasının URL'sini veya LinkType LinkType.URL değilse null değerini döndürür.

Ayrıntılı belgeler

getLinkType()

LinkType değerini döndürür.

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()}`);
}

Return

LinkType

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

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

getLinkedSlide()

URL olmayan bağlantı türleri için varsa bağlı Slide öğesini döndürür. Slayt sunuda yoksa veya LinkType değeri LinkType.URL ise null değerini döndürür.

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()}`);
}

Return

Slide|null

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

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

getSlideId()

LinkType, LinkType.SLIDE_ID değilse bağlı Slide veya null öğesinin kimliğini döndürür.

Döndürülen kimliğe sahip slaytın mevcut olmayabileceğini unutmayın.

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()}`);
}

Return

String|null

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

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

getSlideIndex()

LinkType, LinkType.SLIDE_INDEX değilse bağlı Slide veya null öğesinin sıfır tabanlı dizinini döndürür.

Döndürülen dizindeki slaytın mevcut olmayabileceğini unutmayın.

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()}`);
}

Return

Integer|null

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

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

getSlidePosition()

Bağlı SlidePosition öğesinin Slide değerini veya LinkType değeri LinkType.SLIDE_POSITION değilse null değerini döndürür.

Döndürülen göreli konuma sahip slaytın mevcut olmayabileceğini unutmayın.

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()}`,
  );
}

Return

SlidePosition|null

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

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

getUrl()

Harici web sayfasının URL'sini veya LinkType LinkType.URL değilse null değerini döndürür.

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()}`);
}

Return

String|null

Yetkilendirme

Bu yöntemi kullanan komut dosyaları, aşağıdaki kapsamlardan biri veya daha fazlasıyla yetkilendirme gerektirir:

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