বাল্ক অভিন্ন স্ক্রিপ্ট Rhino থেকে V8 তে স্থানান্তর করে
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
এই পৃষ্ঠাটি বর্ণনা করে কিভাবে অভিন্ন স্ক্রিপ্টগুলিকে Apps Script এবং Apps Script API ব্যবহার করে V8 তে স্থানান্তর করা যায়৷
31 জানুয়ারী, 2026-এ বা তার পরে ঘটছে Rhino বন্ধ করার আগে Rhino রানটাইম ব্যবহার করে এমন যেকোনো স্ক্রিপ্ট আপনাকে অবশ্যই স্থানান্তর করতে হবে। আপনার যদি Rhino-এ একাধিক, অভিন্ন স্ক্রিপ্ট চলমান থাকে, তাহলে আপনি Apps Script API ব্যবহার করে সেগুলিকে V8-এ স্থানান্তর করতে পারেন।
আপনার পরিবেশ সেট আপ করুন
Apps Script ড্যাশবোর্ড সেটিংস থেকে, Apps Script API চালু করুন।
একটি অ্যাপস স্ক্রিপ্ট প্রকল্প তৈরি করুন এবং অ্যাপস স্ক্রিপ্ট প্রকল্পটি আপনার ক্লাউড প্রকল্পে বরাদ্দ করুন।
Apps Script ড্যাশবোর্ড থেকে অথবা script.new এ গিয়ে একটি স্বতন্ত্র অ্যাপস স্ক্রিপ্ট প্রকল্প তৈরি করুন।
প্রকল্প সেটিংস ক্লিক করুন .
Google ক্লাউড প্ল্যাটফর্ম (GCP) প্রকল্প বিভাগে, প্রকল্প পরিবর্তন করুন ক্লিক করুন।
আপনার ক্লাউড প্রকল্পের প্রকল্প নম্বর লিখুন।
সেট প্রকল্প ক্লিক করুন.
স্ক্রিপ্ট স্থানান্তর করুন
নিম্নলিখিত কোড নমুনাটি দেখায় কিভাবে Apps Script API ব্যবহার করে Rhino থেকে V8 তে অভিন্ন স্ক্রিপ্ট স্থানান্তর করতে হয় প্রতিটি Apps Script প্রকল্পের ফাইলগুলিকে V8-সামঞ্জস্যপূর্ণ ফাইলগুলির একটি সেট দিয়ে প্রতিস্থাপন করে৷
আপনি স্থানান্তর করার পরিকল্পনা করছেন এমন স্ক্রিপ্ট প্রকল্পগুলিতে আপনার অন্তত সম্পাদক অ্যাক্সেস রয়েছে তা নিশ্চিত করুন৷
Code.gs
functionupdateRhinoScripts(){// An array of script IDs of script projects to migrate.// TODO(developer): Replace with your script IDs.constscriptIds=['abcdef12345678','abcdef12345678'];// An array of file objects to replace the existing files in each script project.// Remember to include all files for the script, excluded files are deleted.// TODO(developer): Replace with your script files.constfilesToUpdate={"files":[{"name":"Code","type":"SERVER_JS","source":"// New updates\nfunction myFunction() {\n console.log('Hello, world!');\n}"},{"name":"appsscript","type":"JSON","source":JSON.stringify({"timeZone":"America/New_York","dependencies":{},"exceptionLogging":"STACKDRIVER","runtimeVersion":"V8"})}]};updateMultipleAppsScripts(scriptIds,filesToUpdate);}functionupdateMultipleAppsScripts(scriptIds,filesToUpdate){// 'scriptIds' should be an array of script IDs// 'filesToUpdate' should be an array of objects, each with:// name: The filename (For example, "Code", "Utilities")// source: The source code for that file.scriptIds.forEach(function(scriptId){// Makes the API request.constresponse=UrlFetchApp.fetch(`https://script.googleapis.com/v1/projects/${scriptId}/content`,{method:"PUT",headers:{Authorization:`Bearer ${ScriptApp.getOAuthToken()}`},contentType:"application/json",payload:JSON.stringify(filesToUpdate),muteHttpExceptions:true});if(response.getResponseCode()!==200){console.log(`Error updating script ${scriptId}: ${response.getContentText()}`);}else{console.log(`Script ${scriptId} updated successfully!`);}});}
appsscript.json
আপনার Apps স্ক্রিপ্ট প্রকল্পে Apps Script API ব্যবহার করতে, আপনাকে অবশ্যই আপনার ম্যানিফেস্ট ফাইলে নিম্নলিখিত OAuth স্কোপগুলি যোগ করতে হবে:
[null,null,["2025-08-29 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["# Bulk migrate identical scripts from Rhino to V8\n\nThis page describes how to migrate identical scripts to V8 using\nApps Script and the Apps Script API.\n\nYou must migrate any scripts that use the Rhino runtime before Rhino is turned\ndown, happening on or after January 31, 2026. If you have multiple, identical\nscripts running on Rhino, you can migrate them to V8 all together using\nthe Apps Script API.\n\nSet up your environment\n-----------------------\n\n1. From the Apps Script dashboard settings, turn on the Apps Script API.\n 1. Go to the [Apps Script dashboard settings](https://script.google.com/home/usersettings).\n 2. If the API is turned off, click **Google Apps Script API**, then turn on the Google Apps Script API toggle.\n2. [Create a standard Google Cloud project](https://developers.google.com/workspace/guides/create-project#project) or reuse an existing project.\n3. In your Cloud project, [configure the OAuth consent screen](/workspace/guides/configure-oauth-consent).\n4. In your Cloud project, [turn on the Apps Script API](https://developers.google.com/workspace/guides/enable-apis).\n\n [Turn on the Apps Script API](https://console.cloud.google.com/flows/enableapi?apiid=script.googleapis.com)\n5. Create an Apps Script project and assign the\n Apps Script project to your Cloud project.\n\n 1. Create a standalone Apps Script project from the Apps Script dashboard or by going to [script.new](https://script.google.com/home/projects/create).\n 2. Click **Project Settings** .\n 3. In the **Google Cloud Platform (GCP) Project** section, click **Change project**.\n 4. Enter the project number of your Cloud project.\n 5. Click **Set project**.\n\nMigrate scripts\n---------------\n\nThe following code sample shows how to use the Apps Script API to\nmigrate identical scripts from Rhino to V8 by replacing the files in each\nApps Script project with a set of V8-compatible files.\n| **Important:** When you use the [`projects.UpdateContent`](/apps-script/api/reference/rest/v1/projects/updateContent) method of the Apps Script API, you must include all the files in the script project, even ones that you don't want to change. If you don't include a file, the file is deleted and can't be restored.\n\nMake sure you have at least editor access to the script projects you plan to\nmigrate. \n\n### Code.gs\n\n function updateRhinoScripts() {\n // An array of script IDs of script projects to migrate.\n // TODO(developer): Replace with your script IDs.\n const scriptIds = ['abcdef12345678', 'abcdef12345678'];\n // An array of file objects to replace the existing files in each script project.\n // Remember to include all files for the script, excluded files are deleted.\n // TODO(developer): Replace with your script files.\n const filesToUpdate = {\n \"files\": [\n {\n \"name\": \"Code\",\n \"type\": \"SERVER_JS\",\n \"source\": \"// New updates\\nfunction myFunction() {\\n console.log('Hello, world!');\\n}\"\n },\n {\n \"name\": \"appsscript\",\n \"type\": \"JSON\",\n \"source\": JSON.stringify({\n \"timeZone\": \"America/New_York\",\n \"dependencies\": {},\n \"exceptionLogging\": \"STACKDRIVER\",\n \"runtimeVersion\": \"V8\"\n })\n }\n ]\n };\n updateMultipleAppsScripts(scriptIds, filesToUpdate);\n }\n\n function updateMultipleAppsScripts(scriptIds, filesToUpdate) {\n // 'scriptIds' should be an array of script IDs\n // 'filesToUpdate' should be an array of objects, each with:\n // name: The filename (For example, \"Code\", \"Utilities\")\n // source: The source code for that file.\n scriptIds.forEach(function (scriptId) {\n // Makes the API request.\n const response = UrlFetchApp.fetch(\n `https://script.googleapis.com/v1/projects/${scriptId}/content`,\n {\n method: \"PUT\",\n headers: {\n Authorization: `Bearer ${ScriptApp.getOAuthToken()}`\n },\n contentType: \"application/json\",\n payload: JSON.stringify(filesToUpdate),\n muteHttpExceptions: true\n }\n );\n if (response.getResponseCode() !== 200) {\n console.log(`Error updating script ${scriptId}: ${response.getContentText()}`);\n } else {\n console.log(`Script ${scriptId} updated successfully!`);\n }\n });\n }\n\n### appsscript.json\n\nTo use the Apps Script API in your Apps Script\nproject, you must add the following OAuth scopes to your manifest file:\n\n- `\"https://www.googleapis.com/auth/script.projects\"`\n- `\"https://www.googleapis.com/auth/script.external_request\"`\n\nTo expose the manifest file in the editor, click **Project Settings**\n\nand check the **Show \"appsscript.json\" manifest file in editor** box. The\nfollowing is a sample manifest file with the appropriate OAuth scopes: \n\n {\n \"timeZone\": \"America/Denver\",\n \"dependencies\": {\n },\n \"oauthScopes\": [\n \"https://www.googleapis.com/auth/script.projects\",\n \"https://www.googleapis.com/auth/script.external_request\"\n ],\n \"exceptionLogging\": \"STACKDRIVER\",\n \"runtimeVersion\": \"V8\"\n }\n\nRelated topics\n--------------\n\n- [V8 runtime overview](/apps-script/guides/v8-runtime)\n- [Migrate scripts to the V8 runtime](/apps-script/guides/v8-runtime/migration)"]]