Loading...
    • 開発者ガイド
    • APIリファレンス
    • MCP
    • リソース
    • リリースノート
    Search...
    ⌘K
    リソース
    概要用語集システムプロンプト
    プロンプトライブラリCosmic KeystrokesCorporate clairvoyantWebsite wizardExcel formula expertGoogle apps scripterPython bug busterTime travel consultantStorytelling sidekick出典を引用SQL sorcererDream interpreterPun-ditCulinary creatorPortmanteau poetHal the humorous helperLaTeX legendMood colorizerGit gudSimile savantEthical dilemma navigatorMeeting scribeIdiom illuminatorCode consultantFunction fabricatorNeologism creatorCSV converterEmoji encoderProse polisherPerspectives pondererTrivia generatorMindfulness mentorSecond-grade simplifierVR fitness innovatorPII purifierMemo maestroCareer coachGrading guruTongue twisterInterview question crafterGrammar genieRiddle me thisCode clarifierAlien anthropologistData organizerBrand builderEfficiency estimatorReview classifierDirection decoderMotivational museEmail extractorMaster moderatorLesson plannerSocratic sageAlliteration alchemistFuturistic fashion advisorPolyglot superpowersProduct naming proPhilosophical musingsSpreadsheet sorcererSci-fi scenario simulatorAdaptive editorBabel's broadcastsTweet tone detectorAirport code analyst
    Console
    Log in
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...

    Solutions

    • AI agents
    • Code modernization
    • Coding
    • Customer support
    • Education
    • Financial services
    • Government
    • Life sciences

    Partners

    • Amazon Bedrock
    • Google Cloud's Vertex AI

    Learn

    • Blog
    • Catalog
    • Courses
    • Use cases
    • Connectors
    • Customer stories
    • Engineering at Anthropic
    • Events
    • Powered by Claude
    • Service partners
    • Startups program

    Company

    • Anthropic
    • Careers
    • Economic Futures
    • Research
    • News
    • Responsible Scaling Policy
    • Security and compliance
    • Transparency

    Learn

    • Blog
    • Catalog
    • Courses
    • Use cases
    • Connectors
    • Customer stories
    • Engineering at Anthropic
    • Events
    • Powered by Claude
    • Service partners
    • Startups program

    Help and security

    • Availability
    • Status
    • Support
    • Discord

    Terms and policies

    • Privacy policy
    • Responsible disclosure policy
    • Terms of service: Commercial
    • Terms of service: Consumer
    • Usage policy
    プロンプトライブラリ

    Google Apps スクリプター

    ユーザーの要件に基づいてタスクを完了するGoogle Apps スクリプトを生成します。

    このプロンプトを私たちの開発者Consoleにコピーして、自分で試してみてください!

    Content
    UserGoogle Slidesプレゼンテーションのすべてのテキストを韓国語に翻訳するGoogle Apps スクリプトを書いてください。

    出力例

    以下は、Google Slidesプレゼンテーションのすべてのテキストを韓国語に翻訳するGoogle Apps スクリプトです:

    function translateSlidesToKorean() {
      var presentation = SlidesApp.getActivePresentation();
      var slides = presentation.getSlides();
    
      for (var i = 0; i < slides.length; i++) {
        var slide = slides[i];
        var pageElements = slide.getPageElements();
    
        for (var j = 0; j < pageElements.length; j++) {
          var pageElement = pageElements[j];
    
          if (pageElement.getPageElementType() === SlidesApp.PageElementType.SHAPE) {
            var shape = pageElement.asShape();
            if (shape.getText() !== null) {
              var text = shape.getText().asString();
              var translatedText = LanguageApp.translate(text, '', 'ko');
              shape.getText().setText(translatedText);
            }
          } else if (pageElement.getPageElementType() === SlidesApp.PageElementType.TABLE) {
            var table = pageElement.asTable();
            var numRows = table.getNumRows();
            var numColumns = table.getNumColumns();
    
            for (var row = 0; row < numRows; row++) {
              for (var col = 0; col < numColumns; col++) {
                var tableCell = table.getCell(row, col);
                var text = tableCell.getText().asString();
                var translatedText = LanguageApp.translate(text, '', 'ko');
                tableCell.getText().setText(translatedText);
              }
            }
          }
        }
      }
    }

    スクリプトの動作方法は以下の通りです:

    1. translateSlidesToKorean()関数は、SlidesApp.getActivePresentation()を使用してアクティブなGoogle Slidesプレゼンテーションを取得します。

    2. getSlides()メソッドを使用してプレゼンテーション内のすべてのスライドを取得します。

    3. プレゼンテーション内の各スライドを反復処理します。

    4. 各スライドについて、getPageElements()メソッドを使用してすべてのページ要素(図形、テキストボックス、表など)を取得します。

    5. スライド上の各ページ要素を反復処理します。

    6. getPageElementType()を使用してページ要素のタイプをチェックします:

      • ページ要素が図形(SlidesApp.PageElementType.SHAPE)の場合、getText().asString()を使用して図形のテキスト内容を取得します。次に、LanguageApp.translate(text, '', 'ko')を使用してテキストを韓国語に翻訳します。ここで''はソース言語(自動検出)を表し、'ko'はターゲット言語(韓国語)を表します。最後に、setText()を使用して翻訳されたテキストを図形に設定し直します。
      • ページ要素が表(SlidesApp.PageElementType.TABLE)の場合、表内の各セルを反復処理し、図形を処理する方法と同様に各セル内のテキストを翻訳します。
    7. スクリプトは、プレゼンテーション内のすべてのテキストが韓国語に翻訳されるまで、各スライド上のすべてのページ要素の処理を続けます。

    注意: このスクリプトは、Google Slidesプレゼンテーションにアクセスして変更するために必要な権限があることを前提としています。スクリプトを実行する前に、必要なアクセス権があることを確認してください。

    また、翻訳はGoogle Translate APIを使用して実行されるため、翻訳の品質はテキストの複雑さと翻訳サービスの機能によって異なる場合があることを念頭に置いてください。


    APIリクエスト

    • APIリクエスト