Class Link
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Bağlantı
Bir köprü metni.
Ayrıntılı dokümanlar
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ının aşağıdaki kapsamlardan bir veya daha fazlası için yetkilendirilmesi gerekir:
-
https://www.googleapis.com/auth/presentations.currentonly
-
https://www.googleapis.com/auth/presentations
getLinkedSlide()
URL olmayan bağlantı türleri için bağlı Slide
'yi (varsa) döndürür. Slayt sunu içinde yoksa veya LinkType
LinkType.URL
ise null
döndürülü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
Yetkilendirme
Bu yöntemi kullanan komut dosyalarının aşağıdaki kapsamlardan bir veya daha fazlası için yetkilendirilmesi gerekir:
-
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
Yetkilendirme
Bu yöntemi kullanan komut dosyalarının aşağıdaki kapsamlardan bir veya daha fazlası için yetkilendirilmesi gerekir:
-
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ı dizesini 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
Yetkilendirme
Bu yöntemi kullanan komut dosyalarının aşağıdaki kapsamlardan bir veya daha fazlası için yetkilendirilmesi gerekir:
-
https://www.googleapis.com/auth/presentations.currentonly
-
https://www.googleapis.com/auth/presentations
getSlidePosition()
LinkType
LinkType.SLIDE_POSITION
değilse bağlı Slide
öğesinin SlidePosition
değerini veya null
değerini döndürür.
Döndürülen göreli konumun bulunduğu 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
Yetkilendirme
Bu yöntemi kullanan komut dosyalarının aşağıdaki kapsamlardan bir veya daha fazlası için yetkilendirilmesi gerekir:
-
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
Yetkilendirme
Bu yöntemi kullanan komut dosyalarının aşağıdaki kapsamlardan bir veya daha fazlası için yetkilendirilmesi gerekir:
-
https://www.googleapis.com/auth/presentations.currentonly
-
https://www.googleapis.com/auth/presentations
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-26 UTC.
[null,null,["Son güncelleme tarihi: 2025-07-26 UTC."],[[["\u003cp\u003eA \u003ccode\u003eLink\u003c/code\u003e object represents a hypertext link associated with a shape in Google Slides.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to determine the link type, retrieve linked slide information (if applicable), and access the URL for external web page links.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egetLinkType()\u003c/code\u003e method identifies the type of link, such as URL, slide ID, or slide index.\u003c/p\u003e\n"],["\u003cp\u003eMethods like \u003ccode\u003egetLinkedSlide()\u003c/code\u003e, \u003ccode\u003egetSlideId()\u003c/code\u003e, \u003ccode\u003egetSlideIndex()\u003c/code\u003e, and \u003ccode\u003egetSlidePosition()\u003c/code\u003e retrieve information about linked slides based on the link type.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egetUrl()\u003c/code\u003e method returns the URL if the link type is \u003ccode\u003eURL\u003c/code\u003e, otherwise, it returns \u003ccode\u003enull\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Class Link\n\nLink\n\nA hypertext link. \n\n### Methods\n\n| Method | Return type | Brief description |\n|-------------------------------------------|---------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [getLinkType()](#getLinkType()) | [LinkType](/apps-script/reference/slides/link-type) | Returns the [LinkType](/apps-script/reference/slides/link-type). |\n| [getLinkedSlide()](#getLinkedSlide()) | [Slide](/apps-script/reference/slides/slide) | Returns the linked [Slide](/apps-script/reference/slides/slide) for non-URL links types, if it exists. |\n| [getSlideId()](#getSlideId()) | `String` | Returns the ID of the linked [Slide](/apps-script/reference/slides/slide) or `null` if the [LinkType](/apps-script/reference/slides/link-type) is not [LinkType.SLIDE_ID](/apps-script/reference/slides/link-type#SLIDE_ID). |\n| [getSlideIndex()](#getSlideIndex()) | `Integer` | Returns the zero-based index of the linked [Slide](/apps-script/reference/slides/slide) or `null` if the [LinkType](/apps-script/reference/slides/link-type) is not [LinkType.SLIDE_INDEX](/apps-script/reference/slides/link-type#SLIDE_INDEX). |\n| [getSlidePosition()](#getSlidePosition()) | [SlidePosition](/apps-script/reference/slides/slide-position) | Returns the [SlidePosition](/apps-script/reference/slides/slide-position) of the linked [Slide](/apps-script/reference/slides/slide) or `null` if the [LinkType](/apps-script/reference/slides/link-type) is not [LinkType.SLIDE_POSITION](/apps-script/reference/slides/link-type#SLIDE_POSITION). |\n| [getUrl()](#getUrl()) | `String` | Returns the URL to the external web page or `null` if the [LinkType](/apps-script/reference/slides/link-type) is not [LinkType.URL](/apps-script/reference/slides/link-type#URL). |\n\nDetailed documentation\n----------------------\n\n### `get``Link``Type()`\n\nReturns the [LinkType](/apps-script/reference/slides/link-type).\n\n```javascript\nconst shape = SlidesApp.getActivePresentation().getSlides()[0].getShapes()[0];\nconst link = shape.getLink();\nif (link != null) {\n Logger.log(`Shape has a link of type: ${link.getLinkType()}`);\n}\n```\n\n#### Return\n\n\n[LinkType](/apps-script/reference/slides/link-type)\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/presentations.currentonly`\n- `https://www.googleapis.com/auth/presentations`\n\n*** ** * ** ***\n\n### `get``Linked``Slide()`\n\nReturns the linked [Slide](/apps-script/reference/slides/slide) for non-URL links types, if it exists. Returns `null` if\nthe slide doesn't exist in the presentation, or if the [LinkType](/apps-script/reference/slides/link-type) is [LinkType.URL](/apps-script/reference/slides/link-type#URL).\n\n```javascript\nconst shape = SlidesApp.getActivePresentation().getSlides()[0].getShapes()[0];\nconst link = shape.getLink();\nif (link != null && link.getLinkType() !== SlidesApp.LinkType.URL) {\n Logger.log(`Shape has link to slide: ${link.getLinkedSlide()}`);\n}\n```\n\n#### Return\n\n\n[Slide](/apps-script/reference/slides/slide)\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/presentations.currentonly`\n- `https://www.googleapis.com/auth/presentations`\n\n*** ** * ** ***\n\n### `get``Slide``Id()`\n\nReturns the ID of the linked [Slide](/apps-script/reference/slides/slide) or `null` if the [LinkType](/apps-script/reference/slides/link-type) is not\n[LinkType.SLIDE_ID](/apps-script/reference/slides/link-type#SLIDE_ID).\n\nNote that the slide with the returned ID might not exist.\n\n```javascript\nconst shape = SlidesApp.getActivePresentation().getSlides()[0].getShapes()[0];\nconst link = shape.getLink();\nif (link != null && link.getLinkType() === SlidesApp.LinkType.SLIDE_ID) {\n Logger.log(`Shape has link to slide with ID: ${link.getSlideId()}`);\n}\n```\n\n#### Return\n\n\n`String`\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/presentations.currentonly`\n- `https://www.googleapis.com/auth/presentations`\n\n*** ** * ** ***\n\n### `get``Slide``Index()`\n\nReturns the zero-based index of the linked [Slide](/apps-script/reference/slides/slide) or `null` if the [LinkType](/apps-script/reference/slides/link-type) is not [LinkType.SLIDE_INDEX](/apps-script/reference/slides/link-type#SLIDE_INDEX).\n\nNote that the slide at the returned index might not exist.\n\n```javascript\nconst shape = SlidesApp.getActivePresentation().getSlides()[0].getShapes()[0];\nconst link = shape.getLink();\nif (link != null && link.getLinkType() === SlidesApp.LinkType.SLIDE_INDEX) {\n Logger.log(`Shape has link to slide with index: ${link.getSlideIndex()}`);\n}\n```\n\n#### Return\n\n\n`Integer`\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/presentations.currentonly`\n- `https://www.googleapis.com/auth/presentations`\n\n*** ** * ** ***\n\n### `get``Slide``Position()`\n\nReturns the [SlidePosition](/apps-script/reference/slides/slide-position) of the linked [Slide](/apps-script/reference/slides/slide) or `null` if the [LinkType](/apps-script/reference/slides/link-type) is not [LinkType.SLIDE_POSITION](/apps-script/reference/slides/link-type#SLIDE_POSITION).\n\nNote that the slide with the returned relative position might not exist.\n\n```javascript\nconst shape = SlidesApp.getActivePresentation().getSlides()[0].getShapes()[0];\nconst link = shape.getLink();\nif (link != null && link.getLinkType() === SlidesApp.LinkType.SLIDE_POSITION) {\n Logger.log(\n `Shape has link to slide with relative position: ${\n link.getSlidePosition()}`,\n );\n}\n```\n\n#### Return\n\n\n[SlidePosition](/apps-script/reference/slides/slide-position)\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/presentations.currentonly`\n- `https://www.googleapis.com/auth/presentations`\n\n*** ** * ** ***\n\n### `get``Url()`\n\nReturns the URL to the external web page or `null` if the [LinkType](/apps-script/reference/slides/link-type) is not [LinkType.URL](/apps-script/reference/slides/link-type#URL).\n\n```javascript\nconst shape = SlidesApp.getActivePresentation().getSlides()[0].getShapes()[0];\nconst link = shape.getLink();\nif (link != null && link.getLinkType() === SlidesApp.LinkType.URL) {\n Logger.log(`Shape has link to URL: ${link.getUrl()}`);\n}\n```\n\n#### Return\n\n\n`String`\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/presentations.currentonly`\n- `https://www.googleapis.com/auth/presentations`"]]