constshape=SlidesApp.getActivePresentation().getSlides()[0].getShapes()[0];constlink=shape.getLink();if(link!=null){Logger.log(`Shape has a link of type: ${link.getLinkType()}`);}
constshape=SlidesApp.getActivePresentation().getSlides()[0].getShapes()[0];constlink=shape.getLink();if(link!=null && link.getLinkType()!==SlidesApp.LinkType.URL){Logger.log(`Shape has link to slide: ${link.getLinkedSlide()}`);}
constshape=SlidesApp.getActivePresentation().getSlides()[0].getShapes()[0];constlink=shape.getLink();if(link!=null && link.getLinkType()===SlidesApp.LinkType.SLIDE_ID){Logger.log(`Shape has link to slide with ID: ${link.getSlideId()}`);}
constshape=SlidesApp.getActivePresentation().getSlides()[0].getShapes()[0];constlink=shape.getLink();if(link!=null && link.getLinkType()===SlidesApp.LinkType.SLIDE_INDEX){Logger.log(`Shape has link to slide with index: ${link.getSlideIndex()}`);}
constshape=SlidesApp.getActivePresentation().getSlides()[0].getShapes()[0];constlink=shape.getLink();if(link!=null && link.getLinkType()===SlidesApp.LinkType.SLIDE_POSITION){Logger.log(`Shape has link to slide with relative position: ${link.getSlidePosition()}`,);}
constshape=SlidesApp.getActivePresentation().getSlides()[0].getShapes()[0];constlink=shape.getLink();if(link!=null && link.getLinkType()===SlidesApp.LinkType.URL){Logger.log(`Shape has link to URL: ${link.getUrl()}`);}
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 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,["Link\n\nA hypertext link. \n\nMethods\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`get``Link``Type()` \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\nReturn\n\n\n[LinkType](/apps-script/reference/slides/link-type)\n\nAuthorization\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()` \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\nReturn\n\n\n[Slide](/apps-script/reference/slides/slide)\n\nAuthorization\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()` \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\nReturn\n\n\n`String`\n\nAuthorization\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()` \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\nReturn\n\n\n`Integer`\n\nAuthorization\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()` \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\nReturn\n\n\n[SlidePosition](/apps-script/reference/slides/slide-position)\n\nAuthorization\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()` \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\nReturn\n\n\n`String`\n\nAuthorization\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`"]]