{"id":17265,"date":"2025-01-23T13:48:49","date_gmt":"2025-01-23T04:48:49","guid":{"rendered":"https:\/\/84office.jp\/?p=17265"},"modified":"2025-01-23T13:48:49","modified_gmt":"2025-01-23T04:48:49","slug":"business-card-datamation","status":"publish","type":"post","link":"https:\/\/84office.jp\/en\/business-card-datamation\/","title":{"rendered":"Streamline Business Card Digitization with OCR and Google Apps Script: Save Time on Spreadsheet Data Entry"},"content":{"rendered":"<div class=\"codoc-evacuations\" style=\"display:none;\" data-shortcode=\"\"><\/div>\n<div class=\"swell-block-capbox cap_box is-style-small_ttl u-mb-ctrl u-mb-50\" data-colset=\"col3\"><div class=\"cap_box_ttl\" data-has-icon=\"1\"><svg height=\"1em\" width=\"1em\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" aria-hidden=\"true\" viewBox=\"0 0 48 48\"><path d=\"M32 46.5H16c-1.1 0-2-.9-2-2s.9-2 2-2h16c1.1 0 2 .9 2 2s-.9 2-2 2zM33.3 18.6c-.7 0-1.3-.5-1.5-1.2-.7-3.2-3.2-5.7-6.4-6.3-.8-.1-1.4-.9-1.2-1.7s.9-1.4 1.7-1.2c4.4.8 8 4.2 8.9 8.6.2.8-.4 1.6-1.2 1.8h-.3z\"><\/path><path d=\"M30 40.5H18c-2.2 0-4-1.8-4-4v-1.6c0-.6-.3-1.1-.8-1.5C8.4 29.8 5.7 24 6 18c.5-9.1 8-16.6 17.1-17C29 .8 34.5 3.2 38.2 8c1.8 2.3 3 5.1 3.5 7.9 1.1 6.8-1.5 13.3-6.9 17.4-.6.4-.9 1-.9 1.7v1.5c.1 2.2-1.7 4-3.9 4zM23.3 5c-7.1.3-12.9 6.2-13.3 13.2-.2 4.7 1.8 9.1 5.6 11.9 1.5 1.1 2.4 2.9 2.4 4.7v.6c0 .6.4 1 1 1h10c.6 0 1-.4 1-1V35c0-1.9.9-3.7 2.5-4.8 4.3-3.2 6.3-8.5 5.3-13.9-.4-2-1.2-3.8-2.4-5.4-3-4-7.4-6.1-12.1-5.9z\"><\/path><\/svg><span><strong>Recommended for:<\/strong><\/span><\/div><div class=\"cap_box_content\">\n<ul class=\"wp-block-list\">\n<li>Those who spend too much time manually inputting business card information.<\/li>\n\n\n\n<li>Those who want to automate business card data entry and improve workflow efficiency.<\/li>\n<\/ul>\n<\/div><\/div>\n\n\n\n<p>Struggling to manage a growing pile of business cards?<\/p>\n\n\n\n<p>Keeping track of paper business cards can be a hassle. Filing them requires physical space, and finding a specific card when you need it can be time-consuming.<\/p>\n\n\n\n<p>Digitizing business cards makes management much easier, but manually entering data can take up a lot of time.<\/p>\n\n\n\n<p>This is where <strong>Google Apps Script <\/strong>comes in handy.<\/p>\n\n\n\n<p>Google offers a tool called the <strong>Cloud Vision API<\/strong>, which uses OCR technology (Optical Character Recognition) to extract text from images. By combining this tool with GAS, you can automatically extract text data from business card images and input it directly into a Google Spreadsheet.<\/p>\n\n\n\n<p class=\"u-mb-ctrl u-mb-50\">In this article, we\u2019ll guide you through how to use Google Apps Script and the Google Cloud Vision API to automate the process of inputting business card information into a spreadsheet.<\/p>\n\n\n\n<p>You&#8217;ll need a <strong>Google Cloud Vision API key<\/strong> to execute the script.<\/p>\n\n\n\n<p>For detailed instructions on how to obtain the API key, please refer to <a href=\"https:\/\/84office.jp\/en\/google-cloud-vision-api-get\/\">this article<\/a>.<\/p>\n\n\n<div class=\"swell-block-postLink u-mb-ctrl u-mb-60\">\t\t\t<div class=\"p-blogCard -internal\" data-type=\"type1\" data-onclick=\"clickLink\">\n\t\t\t\t<div class=\"p-blogCard__inner\">\n\t\t\t\t\t<span class=\"p-blogCard__caption\">\u3042\u308f\u305b\u3066\u8aad\u307f\u305f\u3044<\/span>\n\t\t\t\t\t<div class=\"p-blogCard__thumb c-postThumb\"><figure class=\"c-postThumb__figure\"><img decoding=\"async\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/513f3a0811e53a7de868b7f72fa4eb1d-2-300x158.png\" alt=\"\" class=\"c-postThumb__img u-obf-cover\" width=\"320\" height=\"180\"><\/figure><\/div>\t\t\t\t\t<div class=\"p-blogCard__body\">\n\t\t\t\t\t\t<a class=\"p-blogCard__title\" href=\"https:\/\/84office.jp\/en\/google-cloud-vision-api-get\/\" target=\"_blank\" rel=\"noopener noreferrer\">How to Get a Google Cloud Vision API Key: A Step-by-Step Guide<\/a>\n\t\t\t\t\t\t<span class=\"p-blogCard__excerpt\">Recommended for: Those looking to streamline their workflow using image recognition technology. Anyone spending too much time manually extracting information&#8230;<\/span>\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\n\n<h2 class=\"wp-block-heading\">Example Output<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large u-mb-ctrl u-mb-40\"><img decoding=\"async\" width=\"1024\" height=\"338\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-94-1024x338.png\" alt=\"\" class=\"wp-image-17269\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-94-1024x338.png 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-94-300x99.png 300w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-94-768x254.png 768w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-94-1536x507.png 1536w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-94-2048x676.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list has-border -border02 u-mb-ctrl u-mb-50 has-swl-pale-03-background-color has-background\">\n<li>Upload business card images to the &#8220;Business Cards&#8221; folder in Google Drive.<\/li>\n\n\n\n<li>Run the GAS script to extract text from the business card images and transfer it to a Google Spreadsheet.<\/li>\n\n\n\n<li>Business card image files that have been processed will be moved to the &#8220;Processed&#8221; folder. \u2190 This article covers up to this point.<\/li>\n\n\n\n<li>Use the ChatGPT API to categorize data into fields (e.g., company name, department, name, etc.). \u2190 Explained in a separate article.<\/li>\n<\/ul>\n\n\n\n<p>In this example, we&#8217;ll demonstrate how to use <strong>Google Apps Script<\/strong> and the <strong>Google Cloud Vision API<\/strong> to extract text from business card images uploaded to Google Drive and organize the extracted data into a Google Spreadsheet.<\/p>\n\n\n\n<p>This article will focus on the process of importing business card images and transferring the extracted text to a spreadsheet.<\/p>\n\n\n\n<p class=\"u-mb-ctrl u-mb-40\">To further organize the data, you can use the <strong>ChatGPT API<\/strong> to automatically distribute the extracted information into specific columns, such as company name, department, and name. This step will be explained in a separate article.<\/p>\n\n\n<div class=\"swell-block-postLink u-mb-ctrl u-mb-60\">\t\t\t<div class=\"p-blogCard -external\" data-type=\"type3\" data-onclick=\"clickLink\">\n\t\t\t\t<div class=\"p-blogCard__inner\">\n\t\t\t\t\t<span class=\"p-blogCard__caption\">\u5408\u540c\u4f1a\u793e\u6a4b\u722a\u30aa\u30d5\u30a3\u30b9<\/span>\n\t\t\t\t\t<div class=\"p-blogCard__thumb c-postThumb\"><figure class=\"c-postThumb__figure\"><img decoding=\"async\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/10\/d1026e539cdfd7cba3c88fa8348bb364.png\" alt=\"\" class=\"c-postThumb__img u-obf-cover\" width=\"320\" height=\"180\"><\/figure><\/div>\t\t\t\t\t<div class=\"p-blogCard__body\">\n\t\t\t\t\t\t<a class=\"p-blogCard__title\" href=\"https:\/\/84office.jp\/classification-chatgpt-googlesheets\/\" target=\"_blank\" rel=\"noopener noreferrer\">ChatGPT API\u3067\u540d\u523a\u30c7\u30fc\u30bf\u3092\u52b9\u7387\u7684\u306b\u5206\u985e\u3059\u308b\u65b9\u6cd5 \uff0d \u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u00d7ChatGPT\u6d3b\u7528 | \u5408\u540c\u4f1a\u793e\u6a4b\u722a\u30aa\u30d5\u30a3\u30b9<\/a>\n\t\t\t\t\t\t<span class=\"p-blogCard__excerpt\">\u3053\u306e\u8a18\u4e8b\u3092\u304a\u3059\u3059\u3081\u306e\u65b9 \u624b\u52d5\u3067\u306e\u540d\u523a\u60c5\u5831\u306e\u5165\u529b\u306b\u6642\u9593\u304c\u304b\u304b\u3063\u3066\u3044\u308b\u65b9 \u540d\u523a\u30c7\u30fc\u30bf\u5165\u529b\u3092\u81ea\u52d5\u5316\u3057\u3066\u696d\u52d9\u3092\u52b9\u7387\u5316\u3057\u305f\u3044\u65b9 \u524d\u56de\u306e\u8a18\u4e8b\u3067\u3001\u540d\u523a\u306e\u30c7\u30fc\u30bf\u3092OCR\uff08\u753b\u50cf\u304b\u3089\u6587\u5b57&#8230;<\/span>\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\n\n<h2 class=\"wp-block-heading\">Steps<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong><strong>Upload Business Card Images to Google Drive<\/strong><\/strong><\/h3>\n\n\n\n<div class=\"swell-block-step u-mb-ctrl u-mb-60\" data-num-style=\"circle\">\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\"><strong>Create a Folder for Business Cards in Google Drive<\/strong><\/div><div class=\"swell-block-step__body\"><div class=\"wp-block-image u-mb-ctrl u-mb-40\">\n<figure class=\"alignleft size-full is-resized\"><img decoding=\"async\" width=\"661\" height=\"388\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-95.png\" alt=\"\" class=\"wp-image-17270\" style=\"width:382px;height:auto\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-95.png 661w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-95-300x176.png 300w\" sizes=\"(max-width: 661px) 100vw, 661px\" \/><\/figure>\n<\/div>\n\n\n<p>Start by creating a folder in Google Drive to store your business card images.<br>(For example, a folder named <strong>&#8220;Business Cards&#8221;<\/strong>).<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\"><strong>Create a &#8220;Processed&#8221; Folder Inside the Business Cards Folder<\/strong><\/div><div class=\"swell-block-step__body\"><div class=\"wp-block-image u-mb-ctrl u-mb-40\">\n<figure class=\"alignleft size-full is-resized\"><img decoding=\"async\" width=\"729\" height=\"422\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-96.png\" alt=\"\" class=\"wp-image-17271\" style=\"width:446px;height:auto\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-96.png 729w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-96-300x174.png 300w\" sizes=\"(max-width: 729px) 100vw, 729px\" \/><\/figure>\n<\/div>\n\n\n<p>Within the <strong>&#8220;Business Cards&#8221;<\/strong> folder you just created, add a new folder named <strong>&#8220;Processed&#8221;<\/strong>.<\/p>\n\n\n\n<p>This folder will serve as the destination for image files after they have been successfully transferred to the spreadsheet.<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\"><strong>Upload Business Card Images to Google Drive<\/strong><\/div><div class=\"swell-block-step__body\"><div class=\"wp-block-image u-mb-ctrl u-mb-40\">\n<figure class=\"alignleft size-full is-resized\"><img decoding=\"async\" width=\"770\" height=\"607\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-97.png\" alt=\"\" class=\"wp-image-17272\" style=\"width:405px;height:auto\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-97.png 770w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-97-300x236.png 300w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-97-768x605.png 768w\" sizes=\"(max-width: 770px) 100vw, 770px\" \/><\/figure>\n<\/div>\n\n\n<p>Upload your business card images to the <strong>&#8220;Business Cards&#8221;<\/strong> folder you created in Google Drive.<br>Both <strong>JPEG<\/strong> and <strong>PDF<\/strong> formats are supported.<\/p>\n<\/div><\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Create and Run Google Apps Script<\/strong><\/h3>\n\n\n\n<div class=\"swell-block-step u-mb-ctrl u-mb-60\" data-num-style=\"circle\">\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\">Prepare the Spreadsheet<\/div><div class=\"swell-block-step__body\">\n<figure class=\"wp-block-image size-large u-mb-ctrl u-mb-40\"><img decoding=\"async\" width=\"1024\" height=\"225\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-99-1024x225.png\" alt=\"\" class=\"wp-image-17274\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-99-1024x225.png 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-99-300x66.png 300w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-99-768x169.png 768w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-99-1536x338.png 1536w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-99-2048x451.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Create a Google Spreadsheet to store the business card data.<\/p>\n\n\n\n<p>In the spreadsheet, set up headers corresponding to the information you want to extract from the business cards, such as <strong>&#8220;Company Name,&#8221; &#8220;Department,&#8221; &#8220;Position,&#8221; &#8220;Name,&#8221; &#8220;Phone Number,&#8221;<\/strong> etc.<\/p>\n\n\n\n<p class=\"u-mb-ctrl u-mb-30\">For this example, name the sheet <strong>&#8220;BizCards&#8221;<\/strong> as it will be referenced in the GAS script.<\/p>\n\n\n\n<p>Example of Column Entries<\/p>\n\n\n\n<figure class=\"wp-block-table is-all-centered u-mb-ctrl u-mb-40\"><table><thead style=\"--thead-color--bg:var(--color_pale03);--thead-color--txt:var(--swl-text_color--black)\"><tr><th><strong>Column<\/strong><\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>A<\/td><td>Company Name<\/td><\/tr><tr><td>B<\/td><td>Department<\/td><\/tr><tr><td>C<\/td><td>Job Title<\/td><\/tr><tr><td>D<\/td><td>Name<\/td><\/tr><tr><td>E<\/td><td>Phone Number<\/td><\/tr><tr><td>F<\/td><td>Mobile Number<\/td><\/tr><tr><td>G<\/td><td>Fax Number<\/td><\/tr><tr><td>H<\/td><td>Email Address<\/td><\/tr><tr><td>I<\/td><td>Company Address<\/td><\/tr><tr><td>J<\/td><td>Website<\/td><\/tr><tr><td>K<\/td><td>Social Media Information<\/td><\/tr><tr><td>L<\/td><td>Notes<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\">Open Apps Script Editor<\/div><div class=\"swell-block-step__body\"><div class=\"wp-block-image u-mb-ctrl u-mb-40\">\n<figure class=\"alignleft size-full is-resized\"><img decoding=\"async\" width=\"933\" height=\"591\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/12\/98efceb7a335447039dff05eb8d70d3d.png\" alt=\"\" class=\"wp-image-16537\" style=\"width:447px;height:auto\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/12\/98efceb7a335447039dff05eb8d70d3d.png 933w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/12\/98efceb7a335447039dff05eb8d70d3d-300x190.png 300w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/12\/98efceb7a335447039dff05eb8d70d3d-768x486.png 768w\" sizes=\"(max-width: 933px) 100vw, 933px\" \/><\/figure>\n<\/div>\n\n\n<p>Open a Google Spreadsheet and click on \u201c<strong>Extensions<\/strong>\u201d in the menu, then \u201c<strong>Apps Script<\/strong>\u201d to open the Apps Script editor.<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\"><strong><strong>Setting Up Google Cloud Vision API<\/strong><\/strong><\/div><div class=\"swell-block-step__body\">\n<figure class=\"wp-block-image size-large u-mb-ctrl u-mb-40\"><img decoding=\"async\" width=\"1024\" height=\"222\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-92-1024x222.png\" alt=\"\" class=\"wp-image-17260\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-92-1024x222.png 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-92-300x65.png 300w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-92-768x167.png 768w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-92-1536x333.png 1536w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-92.png 1642w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Use the API key obtained in the previous article and configure it in the script properties.<\/p>\n\n\n<div class=\"swell-block-postLink u-mb-ctrl u-mb-50\">\t\t\t<div class=\"p-blogCard -internal\" data-type=\"type1\" data-onclick=\"clickLink\">\n\t\t\t\t<div class=\"p-blogCard__inner\">\n\t\t\t\t\t<span class=\"p-blogCard__caption\">\u3042\u308f\u305b\u3066\u8aad\u307f\u305f\u3044<\/span>\n\t\t\t\t\t<div class=\"p-blogCard__thumb c-postThumb\"><figure class=\"c-postThumb__figure\"><img decoding=\"async\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/513f3a0811e53a7de868b7f72fa4eb1d-2-300x158.png\" alt=\"\" class=\"c-postThumb__img u-obf-cover\" width=\"320\" height=\"180\"><\/figure><\/div>\t\t\t\t\t<div class=\"p-blogCard__body\">\n\t\t\t\t\t\t<a class=\"p-blogCard__title\" href=\"https:\/\/84office.jp\/en\/google-cloud-vision-api-get\/\" target=\"_blank\" rel=\"noopener noreferrer\">How to Get a Google Cloud Vision API Key: A Step-by-Step Guide<\/a>\n\t\t\t\t\t\t<span class=\"p-blogCard__excerpt\">Recommended for: Those looking to streamline their workflow using image recognition technology. Anyone spending too much time manually extracting information&#8230;<\/span>\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div><\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\"><strong>Create the Script<\/strong><\/div><div class=\"swell-block-step__body\"><div class=\"wp-block-image u-mb-ctrl u-mb-40\">\n<figure class=\"alignleft size-large\"><img decoding=\"async\" width=\"1024\" height=\"472\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/e5e524d3405a7a1c3cfaaf3f2b1cc662-1024x472.png\" alt=\"\" class=\"wp-image-16191\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/e5e524d3405a7a1c3cfaaf3f2b1cc662-1024x472.png 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/e5e524d3405a7a1c3cfaaf3f2b1cc662-300x138.png 300w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/e5e524d3405a7a1c3cfaaf3f2b1cc662-768x354.png 768w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/e5e524d3405a7a1c3cfaaf3f2b1cc662.png 1387w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"u-mb-ctrl u-mb-40\">Since the default <code>function myFunction() {}<\/code> is present, delete it and replace it with the script below.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"function processBusinessCards() {\n  const folderId = &quot;Insert the ID of the Business Cards folder here&quot;;\n  const folder = DriveApp.getFolderById(folderId);\n  const processedFolder = folder.getFoldersByName(&quot;Processed&quot;).next(); \/\/ Folder for processed files\n  const files = folder.getFiles();\n  const visionApiKey = PropertiesService.getScriptProperties().getProperty(&quot;VISION_API_KEY&quot;);\n  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(&quot;Insert sheet name here&quot;);\n\n  Logger.log(&quot;Starting to process files in folder: &quot; + folderId);\n\n  while (files.hasNext()) {\n    const file = files.next();\n    const imageBlob = file.getBlob();\n    Logger.log(&quot;Processing file: &quot; + file.getName());\n\n    \/\/ Call Google Vision API for OCR\n    const ocrText = callGoogleVisionApi(visionApiKey, imageBlob);\n\n    \/\/ Append OCR results to the spreadsheet\n    if (ocrText) {\n      Logger.log(&quot;OCR Text: &quot; + ocrText);\n      appendToSheet(sheet, ocrText);\n\n      \/\/ Move processed files to &quot;Processed&quot; folder\n      processedFolder.addFile(file);\n      folder.removeFile(file);\n      Logger.log(&quot;File moved to processed folder: &quot; + file.getName());\n    } else {\n      Logger.log(&quot;No text detected for file: &quot; + file.getName());\n    }\n  }\n\n  Logger.log(&quot;Processing completed for all files in folder: &quot; + folderId);\n}\n\nfunction callGoogleVisionApi(apiKey, imageBlob) {\n  const url = `https:\/\/vision.googleapis.com\/v1\/images:annotate?key=${apiKey}`;\n  const requestBody = {\n    &quot;requests&quot;: [\n      {\n        &quot;image&quot;: {\n          &quot;content&quot;: Utilities.base64Encode(imageBlob.getBytes())\n        },\n        &quot;features&quot;: [\n          {\n            &quot;type&quot;: &quot;TEXT_DETECTION&quot;\n          }\n        ]\n      }\n    ]\n  };\n\n  const options = {\n    &quot;method&quot;: &quot;post&quot;,\n    &quot;contentType&quot;: &quot;application\/json&quot;,\n    &quot;payload&quot;: JSON.stringify(requestBody)\n  };\n\n  try {\n    const response = UrlFetchApp.fetch(url, options);\n    const json = JSON.parse(response.getContentText());\n    Logger.log(&quot;Vision API response: &quot; + response.getContentText());\n    const textAnnotations = json.responses[0].textAnnotations;\n    if (textAnnotations &amp;&amp; textAnnotations.length &gt; 0) {\n      return textAnnotations[0].description;\n    }\n  } catch (e) {\n    Logger.log(&quot;Error during Vision API call: &quot; + e.message);\n  }\n  return null;\n}\n\nfunction appendToSheet(sheet, ocrText) {\n  const rows = ocrText.split('\\n');\n  const newRow = Array(12).fill(&quot;&quot;); \/\/ Create an empty array for 12 columns\n\n  \/\/ Append entire OCR text to the sheet (for debugging)\n  sheet.appendRow([ocrText]);\n\n  \/\/ Extract data corresponding to each spreadsheet column\n  rows.forEach(row =&gt; {\n    if (row.includes(&quot;Name&quot;)) {\n      newRow[0] = row.split(&quot;:&quot;)[1]?.trim() || &quot;&quot;;\n    } else if (row.includes(&quot;Company&quot;)) {\n      newRow[1] = row.split(&quot;:&quot;)[1]?.trim() || &quot;&quot;;\n    }\n    \/\/ Add more conditions for other fields as needed\n  });\n\n  \/\/ Append new row to the sheet (only if it contains data)\n  if (newRow.some(cell =&gt; cell !== &quot;&quot;)) {\n    sheet.appendRow(newRow);\n  }\n}\n\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #66D9EF; font-style: italic\">function<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #A6E22E\">processBusinessCards<\/span><span style=\"color: #F8F8F2\">() {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> folderId <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;Insert the ID of the Business Cards folder here&quot;<\/span><span style=\"color: #F8F8F2\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> folder <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> DriveApp.<\/span><span style=\"color: #A6E22E\">getFolderById<\/span><span style=\"color: #F8F8F2\">(folderId);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> processedFolder <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> folder.<\/span><span style=\"color: #A6E22E\">getFoldersByName<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;Processed&quot;<\/span><span style=\"color: #F8F8F2\">).<\/span><span style=\"color: #A6E22E\">next<\/span><span style=\"color: #F8F8F2\">(); <\/span><span style=\"color: #88846F\">\/\/ Folder for processed files<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> files <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> folder.<\/span><span style=\"color: #A6E22E\">getFiles<\/span><span style=\"color: #F8F8F2\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> visionApiKey <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> PropertiesService.<\/span><span style=\"color: #A6E22E\">getScriptProperties<\/span><span style=\"color: #F8F8F2\">().<\/span><span style=\"color: #A6E22E\">getProperty<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;VISION_API_KEY&quot;<\/span><span style=\"color: #F8F8F2\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> sheet <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> SpreadsheetApp.<\/span><span style=\"color: #A6E22E\">getActiveSpreadsheet<\/span><span style=\"color: #F8F8F2\">().<\/span><span style=\"color: #A6E22E\">getSheetByName<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;Insert sheet name here&quot;<\/span><span style=\"color: #F8F8F2\">);<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  Logger.<\/span><span style=\"color: #A6E22E\">log<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;Starting to process files in folder: &quot;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> folderId);<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #F92672\">while<\/span><span style=\"color: #F8F8F2\"> (files.<\/span><span style=\"color: #A6E22E\">hasNext<\/span><span style=\"color: #F8F8F2\">()) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> file <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> files.<\/span><span style=\"color: #A6E22E\">next<\/span><span style=\"color: #F8F8F2\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> imageBlob <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> file.<\/span><span style=\"color: #A6E22E\">getBlob<\/span><span style=\"color: #F8F8F2\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    Logger.<\/span><span style=\"color: #A6E22E\">log<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;Processing file: &quot;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> file.<\/span><span style=\"color: #A6E22E\">getName<\/span><span style=\"color: #F8F8F2\">());<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #88846F\">\/\/ Call Google Vision API for OCR<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> ocrText <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #A6E22E\">callGoogleVisionApi<\/span><span style=\"color: #F8F8F2\">(visionApiKey, imageBlob);<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #88846F\">\/\/ Append OCR results to the spreadsheet<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #F92672\">if<\/span><span style=\"color: #F8F8F2\"> (ocrText) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      Logger.<\/span><span style=\"color: #A6E22E\">log<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;OCR Text: &quot;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> ocrText);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      <\/span><span style=\"color: #A6E22E\">appendToSheet<\/span><span style=\"color: #F8F8F2\">(sheet, ocrText);<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      <\/span><span style=\"color: #88846F\">\/\/ Move processed files to &quot;Processed&quot; folder<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      processedFolder.<\/span><span style=\"color: #A6E22E\">addFile<\/span><span style=\"color: #F8F8F2\">(file);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      folder.<\/span><span style=\"color: #A6E22E\">removeFile<\/span><span style=\"color: #F8F8F2\">(file);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      Logger.<\/span><span style=\"color: #A6E22E\">log<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;File moved to processed folder: &quot;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> file.<\/span><span style=\"color: #A6E22E\">getName<\/span><span style=\"color: #F8F8F2\">());<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    } <\/span><span style=\"color: #F92672\">else<\/span><span style=\"color: #F8F8F2\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      Logger.<\/span><span style=\"color: #A6E22E\">log<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;No text detected for file: &quot;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> file.<\/span><span style=\"color: #A6E22E\">getName<\/span><span style=\"color: #F8F8F2\">());<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  }<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  Logger.<\/span><span style=\"color: #A6E22E\">log<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;Processing completed for all files in folder: &quot;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> folderId);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #66D9EF; font-style: italic\">function<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #A6E22E\">callGoogleVisionApi<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #FD971F; font-style: italic\">apiKey<\/span><span style=\"color: #F8F8F2\">, <\/span><span style=\"color: #FD971F; font-style: italic\">imageBlob<\/span><span style=\"color: #F8F8F2\">) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> url <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">`https:\/\/vision.googleapis.com\/v1\/images:annotate?key=<\/span><span style=\"color: #F92672\">${<\/span><span style=\"color: #F8F8F2\">apiKey<\/span><span style=\"color: #F92672\">}<\/span><span style=\"color: #E6DB74\">`<\/span><span style=\"color: #F8F8F2\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> requestBody <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #E6DB74\">&quot;requests&quot;<\/span><span style=\"color: #F8F8F2\">: [<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">        <\/span><span style=\"color: #E6DB74\">&quot;image&quot;<\/span><span style=\"color: #F8F8F2\">: {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">          <\/span><span style=\"color: #E6DB74\">&quot;content&quot;<\/span><span style=\"color: #F8F8F2\">: Utilities.<\/span><span style=\"color: #A6E22E\">base64Encode<\/span><span style=\"color: #F8F8F2\">(imageBlob.<\/span><span style=\"color: #A6E22E\">getBytes<\/span><span style=\"color: #F8F8F2\">())<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">        },<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">        <\/span><span style=\"color: #E6DB74\">&quot;features&quot;<\/span><span style=\"color: #F8F8F2\">: [<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">          {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">            <\/span><span style=\"color: #E6DB74\">&quot;type&quot;<\/span><span style=\"color: #F8F8F2\">: <\/span><span style=\"color: #E6DB74\">&quot;TEXT_DETECTION&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">          }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">        ]<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    ]<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  };<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> options <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #E6DB74\">&quot;method&quot;<\/span><span style=\"color: #F8F8F2\">: <\/span><span style=\"color: #E6DB74\">&quot;post&quot;<\/span><span style=\"color: #F8F8F2\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #E6DB74\">&quot;contentType&quot;<\/span><span style=\"color: #F8F8F2\">: <\/span><span style=\"color: #E6DB74\">&quot;application\/json&quot;<\/span><span style=\"color: #F8F8F2\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #E6DB74\">&quot;payload&quot;<\/span><span style=\"color: #F8F8F2\">: JSON.<\/span><span style=\"color: #A6E22E\">stringify<\/span><span style=\"color: #F8F8F2\">(requestBody)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  };<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #F92672\">try<\/span><span style=\"color: #F8F8F2\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> response <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> UrlFetchApp.<\/span><span style=\"color: #A6E22E\">fetch<\/span><span style=\"color: #F8F8F2\">(url, options);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> json <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> JSON.<\/span><span style=\"color: #A6E22E\">parse<\/span><span style=\"color: #F8F8F2\">(response.<\/span><span style=\"color: #A6E22E\">getContentText<\/span><span style=\"color: #F8F8F2\">());<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    Logger.<\/span><span style=\"color: #A6E22E\">log<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;Vision API response: &quot;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> response.<\/span><span style=\"color: #A6E22E\">getContentText<\/span><span style=\"color: #F8F8F2\">());<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> textAnnotations <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> json.responses[<\/span><span style=\"color: #AE81FF\">0<\/span><span style=\"color: #F8F8F2\">].textAnnotations;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #F92672\">if<\/span><span style=\"color: #F8F8F2\"> (textAnnotations <\/span><span style=\"color: #F92672\">&amp;&amp;<\/span><span style=\"color: #F8F8F2\"> textAnnotations.length <\/span><span style=\"color: #F92672\">&gt;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #AE81FF\">0<\/span><span style=\"color: #F8F8F2\">) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      <\/span><span style=\"color: #F92672\">return<\/span><span style=\"color: #F8F8F2\"> textAnnotations[<\/span><span style=\"color: #AE81FF\">0<\/span><span style=\"color: #F8F8F2\">].description;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  } <\/span><span style=\"color: #F92672\">catch<\/span><span style=\"color: #F8F8F2\"> (e) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    Logger.<\/span><span style=\"color: #A6E22E\">log<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;Error during Vision API call: &quot;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> e.message);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #F92672\">return<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #AE81FF\">null<\/span><span style=\"color: #F8F8F2\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #66D9EF; font-style: italic\">function<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #A6E22E\">appendToSheet<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #FD971F; font-style: italic\">sheet<\/span><span style=\"color: #F8F8F2\">, <\/span><span style=\"color: #FD971F; font-style: italic\">ocrText<\/span><span style=\"color: #F8F8F2\">) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> rows <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> ocrText.<\/span><span style=\"color: #A6E22E\">split<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&#39;<\/span><span style=\"color: #AE81FF\">\\n<\/span><span style=\"color: #E6DB74\">&#39;<\/span><span style=\"color: #F8F8F2\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> newRow <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #A6E22E\">Array<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #AE81FF\">12<\/span><span style=\"color: #F8F8F2\">).<\/span><span style=\"color: #A6E22E\">fill<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;&quot;<\/span><span style=\"color: #F8F8F2\">); <\/span><span style=\"color: #88846F\">\/\/ Create an empty array for 12 columns<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #88846F\">\/\/ Append entire OCR text to the sheet (for debugging)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  sheet.<\/span><span style=\"color: #A6E22E\">appendRow<\/span><span style=\"color: #F8F8F2\">([ocrText]);<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #88846F\">\/\/ Extract data corresponding to each spreadsheet column<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  rows.<\/span><span style=\"color: #A6E22E\">forEach<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #FD971F; font-style: italic\">row<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #66D9EF; font-style: italic\">=&gt;<\/span><span style=\"color: #F8F8F2\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #F92672\">if<\/span><span style=\"color: #F8F8F2\"> (row.<\/span><span style=\"color: #A6E22E\">includes<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;Name&quot;<\/span><span style=\"color: #F8F8F2\">)) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      newRow[<\/span><span style=\"color: #AE81FF\">0<\/span><span style=\"color: #F8F8F2\">] <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> row.<\/span><span style=\"color: #A6E22E\">split<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;:&quot;<\/span><span style=\"color: #F8F8F2\">)[<\/span><span style=\"color: #AE81FF\">1<\/span><span style=\"color: #F8F8F2\">]?.<\/span><span style=\"color: #A6E22E\">trim<\/span><span style=\"color: #F8F8F2\">() <\/span><span style=\"color: #F92672\">||<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;&quot;<\/span><span style=\"color: #F8F8F2\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    } <\/span><span style=\"color: #F92672\">else<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">if<\/span><span style=\"color: #F8F8F2\"> (row.<\/span><span style=\"color: #A6E22E\">includes<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;Company&quot;<\/span><span style=\"color: #F8F8F2\">)) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      newRow[<\/span><span style=\"color: #AE81FF\">1<\/span><span style=\"color: #F8F8F2\">] <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> row.<\/span><span style=\"color: #A6E22E\">split<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;:&quot;<\/span><span style=\"color: #F8F8F2\">)[<\/span><span style=\"color: #AE81FF\">1<\/span><span style=\"color: #F8F8F2\">]?.<\/span><span style=\"color: #A6E22E\">trim<\/span><span style=\"color: #F8F8F2\">() <\/span><span style=\"color: #F92672\">||<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;&quot;<\/span><span style=\"color: #F8F8F2\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #88846F\">\/\/ Add more conditions for other fields as needed<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  });<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #88846F\">\/\/ Append new row to the sheet (only if it contains data)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #F92672\">if<\/span><span style=\"color: #F8F8F2\"> (newRow.<\/span><span style=\"color: #A6E22E\">some<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #FD971F; font-style: italic\">cell<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #66D9EF; font-style: italic\">=&gt;<\/span><span style=\"color: #F8F8F2\"> cell <\/span><span style=\"color: #F92672\">!==<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;&quot;<\/span><span style=\"color: #F8F8F2\">)) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    sheet.<\/span><span style=\"color: #A6E22E\">appendRow<\/span><span style=\"color: #F8F8F2\">(newRow);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">}<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<div class=\"swell-block-accordion\">\n<details class=\"swell-block-accordion__item\" data-swl-acc=\"wrapper\"><summary class=\"swell-block-accordion__title\" data-swl-acc=\"header\"><span class=\"swell-block-accordion__label\">Script Description<\/span><span class=\"swell-block-accordion__icon c-switchIconBtn\" data-swl-acc=\"icon\" aria-hidden=\"true\" data-opened=\"false\"><i class=\"__icon--closed icon-caret-down\"><\/i><i class=\"__icon--opened icon-caret-up\"><\/i><\/span><\/summary><div class=\"swell-block-accordion__body\" data-swl-acc=\"body\">\n<dl class=\"swell-block-dl\">\n<dt class=\"swell-block-dl__dt\"><code>processBusinessCards()<\/code> Function<\/dt>\n\n\n\n<dd class=\"swell-block-dl__dd u-mb-ctrl u-mb-40\">\n<p class=\"u-mb-ctrl u-mb-30\">This function manages the entire process of extracting text from business card images stored in Google Drive, using the Google Vision API, and transferring the extracted data to a Google Spreadsheet.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"function processBusinessCards() {\n  const folderId = &quot;Insert the ID of the Business Cards folder here&quot;;\n  const folder = DriveApp.getFolderById(folderId);\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #66D9EF; font-style: italic\">function<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #A6E22E\">processBusinessCards<\/span><span style=\"color: #F8F8F2\">() {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> folderId <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;Insert the ID of the Business Cards folder here&quot;<\/span><span style=\"color: #F8F8F2\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> folder <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> DriveApp.<\/span><span style=\"color: #A6E22E\">getFolderById<\/span><span style=\"color: #F8F8F2\">(folderId);<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list u-mb-ctrl u-mb-40\">\n<li><strong><code>folderId<\/code><\/strong>: Specify the ID of the folder where the business card images are stored.<\/li>\n\n\n\n<li>You can retrieve the ID from the URL of the folder in Google Drive and input it here.<\/li>\n\n\n\n<li><strong><code>folder = DriveApp.getFolderById(folderId)<\/code><\/strong>: Use <code>DriveApp<\/code> to access the folder specified by the <code>folderId<\/code>.<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"  const processedFolder = folder.getFoldersByName(&quot;Processed&quot;).next(); \/\/ Folder for processed files\n\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> processedFolder <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> folder.<\/span><span style=\"color: #A6E22E\">getFoldersByName<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;Processed&quot;<\/span><span style=\"color: #F8F8F2\">).<\/span><span style=\"color: #A6E22E\">next<\/span><span style=\"color: #F8F8F2\">(); <\/span><span style=\"color: #88846F\">\/\/ Folder for processed files<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>processedFolder<\/code><\/strong>: Retrieves the folder named <strong>&#8220;Processed&#8221;<\/strong>.<\/li>\n\n\n\n<li>This folder is used to store business card files that have been processed.<\/li>\n\n\n\n<li class=\"u-mb-ctrl u-mb-40\"><strong><code>next()<\/code><\/strong>: Since <code>getFoldersByName()<\/code> returns an iterator, use <code>next()<\/code> to get the first folder from the list.<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"  const files = folder.getFiles();\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> files <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> folder.<\/span><span style=\"color: #A6E22E\">getFiles<\/span><span style=\"color: #F8F8F2\">();<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list u-mb-ctrl u-mb-40\">\n<li><strong><code>files = folder.getFiles()<\/code><\/strong>: Retrieves all the files contained in the specified folder.<\/li>\n\n\n\n<li>These files include the business card images to be processed.<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"  const visionApiKey = PropertiesService.getScriptProperties().getProperty(&quot;VISION_API_KEY&quot;);\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> visionApiKey <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> PropertiesService.<\/span><span style=\"color: #A6E22E\">getScriptProperties<\/span><span style=\"color: #F8F8F2\">().<\/span><span style=\"color: #A6E22E\">getProperty<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;VISION_API_KEY&quot;<\/span><span style=\"color: #F8F8F2\">);<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li class=\"u-mb-ctrl u-mb-40\"><strong><code>visionApiKey<\/code><\/strong>: Retrieves the Google Vision API key stored in the script properties. This key is required to make requests to the Google Vision API.<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(&quot;Insert sheet name here&quot;);\n\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> sheet <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> SpreadsheetApp.<\/span><span style=\"color: #A6E22E\">getActiveSpreadsheet<\/span><span style=\"color: #F8F8F2\">().<\/span><span style=\"color: #A6E22E\">getSheetByName<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;Insert sheet name here&quot;<\/span><span style=\"color: #F8F8F2\">);<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li class=\"u-mb-ctrl u-mb-40\"><strong><code>sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(...)<\/code><\/strong>: Retrieves the sheet with the specified name from the active Google Spreadsheet. This sheet is where the extracted data will be input. (e.g., <strong>BizCards<\/strong>)<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"  while (files.hasNext()) {\n    const file = files.next();\n    const imageBlob = file.getBlob();\n    Logger.log(&quot;Processing file: &quot; + file.getName());\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #F92672\">while<\/span><span style=\"color: #F8F8F2\"> (files.<\/span><span style=\"color: #A6E22E\">hasNext<\/span><span style=\"color: #F8F8F2\">()) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> file <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> files.<\/span><span style=\"color: #A6E22E\">next<\/span><span style=\"color: #F8F8F2\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> imageBlob <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> file.<\/span><span style=\"color: #A6E22E\">getBlob<\/span><span style=\"color: #F8F8F2\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    Logger.<\/span><span style=\"color: #A6E22E\">log<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;Processing file: &quot;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> file.<\/span><span style=\"color: #A6E22E\">getName<\/span><span style=\"color: #F8F8F2\">());<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list u-mb-ctrl u-mb-40\">\n<li><strong><code>while (files.hasNext())<\/code><\/strong>: Continues looping as long as there are files remaining in the <code>files<\/code> object.<\/li>\n\n\n\n<li><strong><code>file = files.next()<\/code><\/strong>: Retrieves the next file in the <code>files<\/code> object.<\/li>\n\n\n\n<li><strong><code>imageBlob = file.getBlob()<\/code><\/strong>: Converts the file into a Blob format. The Blob format is used to handle binary data and is required for sending data to the API.<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"    const ocrText = callGoogleVisionApi(visionApiKey, imageBlob);\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> ocrText <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #A6E22E\">callGoogleVisionApi<\/span><span style=\"color: #F8F8F2\">(visionApiKey, imageBlob);<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list u-mb-ctrl u-mb-40\">\n<li><strong><code>ocrText = callGoogleVisionApi(...)<\/code><\/strong>: Calls the <code>callGoogleVisionApi<\/code> function to extract text information from the image.<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"    if (ocrText) {\n      Logger.log(&quot;OCR Text: &quot; + ocrText);\n      appendToSheet(sheet, ocrText);\n\n      \/\/ Move processed files to &quot;Processed&quot; folder\n      processedFolder.addFile(file);\n      folder.removeFile(file);\n      Logger.log(&quot;File moved to processed folder: &quot; + file.getName());\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #F92672\">if<\/span><span style=\"color: #F8F8F2\"> (ocrText) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      Logger.<\/span><span style=\"color: #A6E22E\">log<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;OCR Text: &quot;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> ocrText);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      <\/span><span style=\"color: #A6E22E\">appendToSheet<\/span><span style=\"color: #F8F8F2\">(sheet, ocrText);<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      <\/span><span style=\"color: #88846F\">\/\/ Move processed files to &quot;Processed&quot; folder<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      processedFolder.<\/span><span style=\"color: #A6E22E\">addFile<\/span><span style=\"color: #F8F8F2\">(file);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      folder.<\/span><span style=\"color: #A6E22E\">removeFile<\/span><span style=\"color: #F8F8F2\">(file);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      Logger.<\/span><span style=\"color: #A6E22E\">log<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;File moved to processed folder: &quot;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> file.<\/span><span style=\"color: #A6E22E\">getName<\/span><span style=\"color: #F8F8F2\">());<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list u-mb-ctrl u-mb-60\">\n<li><strong><code>if (ocrText)<\/code><\/strong>: Executes the following steps only if the OCR process is successful and text is detected.<\/li>\n\n\n\n<li><strong><code>appendToSheet(sheet, ocrText)<\/code><\/strong>: Adds the extracted text to the specified sheet.<\/li>\n\n\n\n<li><strong><code>processedFolder.addFile(file)<\/code><\/strong> and <strong><code>folder.removeFile(file)<\/code><\/strong>: Moves the processed file to the <strong>&#8220;Processed&#8221;<\/strong> folder by adding it to the folder and then removing it from the original folder.<\/li>\n<\/ul>\n<\/dd>\n\n\n\n<dt class=\"swell-block-dl__dt\"><code>callGoogleVisionApi(apiKey, imageBlob)<\/code> Function<\/dt>\n\n\n\n<dd class=\"swell-block-dl__dd u-mb-ctrl u-mb-40\">\n<p class=\"u-mb-ctrl u-mb-30\">This function handles the process of extracting text from images using the Google Vision API.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"function callGoogleVisionApi(apiKey, imageBlob) {\n  const url = `https:\/\/vision.googleapis.com\/v1\/images:annotate?key=${apiKey}`;\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #66D9EF; font-style: italic\">function<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #A6E22E\">callGoogleVisionApi<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #FD971F; font-style: italic\">apiKey<\/span><span style=\"color: #F8F8F2\">, <\/span><span style=\"color: #FD971F; font-style: italic\">imageBlob<\/span><span style=\"color: #F8F8F2\">) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> url <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">`https:\/\/vision.googleapis.com\/v1\/images:annotate?key=<\/span><span style=\"color: #F92672\">${<\/span><span style=\"color: #F8F8F2\">apiKey<\/span><span style=\"color: #F92672\">}<\/span><span style=\"color: #E6DB74\">`<\/span><span style=\"color: #F8F8F2\">;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li class=\"u-mb-ctrl u-mb-40\"><strong><code>url<\/code><\/strong>: The endpoint URL for the Google Vision API.<br>The API key is included as a query parameter in the URL to authenticate the request.<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"  const requestBody = {\n    &quot;requests&quot;: [\n      {\n        &quot;image&quot;: {\n          &quot;content&quot;: Utilities.base64Encode(imageBlob.getBytes())\n        },\n        &quot;features&quot;: [\n          {\n            &quot;type&quot;: &quot;TEXT_DETECTION&quot;\n          }\n        ]\n      }\n    ]\n  };\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> requestBody <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #E6DB74\">&quot;requests&quot;<\/span><span style=\"color: #F8F8F2\">: [<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">        <\/span><span style=\"color: #E6DB74\">&quot;image&quot;<\/span><span style=\"color: #F8F8F2\">: {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">          <\/span><span style=\"color: #E6DB74\">&quot;content&quot;<\/span><span style=\"color: #F8F8F2\">: Utilities.<\/span><span style=\"color: #A6E22E\">base64Encode<\/span><span style=\"color: #F8F8F2\">(imageBlob.<\/span><span style=\"color: #A6E22E\">getBytes<\/span><span style=\"color: #F8F8F2\">())<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">        },<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">        <\/span><span style=\"color: #E6DB74\">&quot;features&quot;<\/span><span style=\"color: #F8F8F2\">: [<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">          {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">            <\/span><span style=\"color: #E6DB74\">&quot;type&quot;<\/span><span style=\"color: #F8F8F2\">: <\/span><span style=\"color: #E6DB74\">&quot;TEXT_DETECTION&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">          }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">        ]<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    ]<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  };<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list u-mb-ctrl u-mb-40\">\n<li><strong><code>requestBody<\/code><\/strong>: The request body sent to the Vision API.<\/li>\n\n\n\n<li><strong><code>\"image\"<\/code><\/strong>: Contains the <code>imageBlob<\/code> encoded in Base64 format. This conversion ensures the image data is in a format that the API can process.<\/li>\n\n\n\n<li><strong><code>\"features\"<\/code><\/strong>: Specifies the feature to detect from the image.<br>In this case, <code>\"TEXT_DETECTION\"<\/code> is used to extract text from the image.<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"  const options = {\n    &quot;method&quot;: &quot;post&quot;,\n    &quot;contentType&quot;: &quot;application\/json&quot;,\n    &quot;payload&quot;: JSON.stringify(requestBody)\n  };\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> options <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #E6DB74\">&quot;method&quot;<\/span><span style=\"color: #F8F8F2\">: <\/span><span style=\"color: #E6DB74\">&quot;post&quot;<\/span><span style=\"color: #F8F8F2\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #E6DB74\">&quot;contentType&quot;<\/span><span style=\"color: #F8F8F2\">: <\/span><span style=\"color: #E6DB74\">&quot;application\/json&quot;<\/span><span style=\"color: #F8F8F2\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #E6DB74\">&quot;payload&quot;<\/span><span style=\"color: #F8F8F2\">: JSON.<\/span><span style=\"color: #A6E22E\">stringify<\/span><span style=\"color: #F8F8F2\">(requestBody)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  };<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list u-mb-ctrl u-mb-40\">\n<li><strong><code>options<\/code><\/strong>: The configuration settings for the request sent to the Vision API via the <code>UrlFetchApp.fetch()<\/code> method.<\/li>\n\n\n\n<li><strong><code>\"method\"<\/code><\/strong>: Specifies the HTTP method to use. In this case, it is set to <strong>POST<\/strong>.<\/li>\n\n\n\n<li><strong><code>\"contentType\"<\/code><\/strong>: Defines the content type of the request. The value is set to <strong><code>application\/json<\/code><\/strong>, as the request body is in JSON format.<\/li>\n\n\n\n<li><strong><code>\"payload\"<\/code><\/strong>: Converts the request body into a JSON string to be sent with the POST request.<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"  try {\n    const response = UrlFetchApp.fetch(url, options);\n    const json = JSON.parse(response.getContentText());\n    Logger.log(&quot;Vision API response: &quot; + response.getContentText());\n    const textAnnotations = json.responses[0].textAnnotations;\n    if (textAnnotations &amp;&amp; textAnnotations.length &gt; 0) {\n      return textAnnotations[0].description;\n    }\n  } catch (e) {\n    Logger.log(&quot;Error during Vision API call: &quot; + e.message);\n  }\n  return null;\n}\n\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #F92672\">try<\/span><span style=\"color: #F8F8F2\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> response <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> UrlFetchApp.<\/span><span style=\"color: #A6E22E\">fetch<\/span><span style=\"color: #F8F8F2\">(url, options);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> json <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> JSON.<\/span><span style=\"color: #A6E22E\">parse<\/span><span style=\"color: #F8F8F2\">(response.<\/span><span style=\"color: #A6E22E\">getContentText<\/span><span style=\"color: #F8F8F2\">());<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    Logger.<\/span><span style=\"color: #A6E22E\">log<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;Vision API response: &quot;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> response.<\/span><span style=\"color: #A6E22E\">getContentText<\/span><span style=\"color: #F8F8F2\">());<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> textAnnotations <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> json.responses[<\/span><span style=\"color: #AE81FF\">0<\/span><span style=\"color: #F8F8F2\">].textAnnotations;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #F92672\">if<\/span><span style=\"color: #F8F8F2\"> (textAnnotations <\/span><span style=\"color: #F92672\">&amp;&amp;<\/span><span style=\"color: #F8F8F2\"> textAnnotations.length <\/span><span style=\"color: #F92672\">&gt;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #AE81FF\">0<\/span><span style=\"color: #F8F8F2\">) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      <\/span><span style=\"color: #F92672\">return<\/span><span style=\"color: #F8F8F2\"> textAnnotations[<\/span><span style=\"color: #AE81FF\">0<\/span><span style=\"color: #F8F8F2\">].description;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  } <\/span><span style=\"color: #F92672\">catch<\/span><span style=\"color: #F8F8F2\"> (e) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    Logger.<\/span><span style=\"color: #A6E22E\">log<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;Error during Vision API call: &quot;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> e.message);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #F92672\">return<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #AE81FF\">null<\/span><span style=\"color: #F8F8F2\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">}<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list u-mb-ctrl u-mb-60\">\n<li><strong><code>UrlFetchApp.fetch(url, options)<\/code><\/strong>: <br>Sends the request to the Google Vision API using the provided URL and options. The method retrieves the response from the API.<\/li>\n\n\n\n<li><code>JSON.parse(response.getContentText())<\/code>:<br>Converts the API response, which is returned as a string, into a JSON object for easier data manipulation.<\/li>\n\n\n\n<li><strong><code>textAnnotations[0].description<\/code><\/strong>: <br>Extracts the first entry from the <code>textAnnotations<\/code> array in the response, which contains the recognized text. This text is returned as the result of the OCR process.<\/li>\n\n\n\n<li>Error Handling with <code>catch<\/code>: <br>If an error occurs during the API request or response parsing, the <strong><code>catch<\/code><\/strong> block logs the error message to the script logs, helping diagnose issues.<\/li>\n<\/ul>\n<\/dd>\n\n\n\n<dt class=\"swell-block-dl__dt\"><code>appendToSheet(sheet, ocrText)<\/code> Function<\/dt>\n\n\n\n<dd class=\"swell-block-dl__dd\">\n<p class=\"u-mb-ctrl u-mb-30\">This function handles writing the OCR results to a Google Spreadsheet.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"function appendToSheet(sheet, ocrText) {\n  const rows = ocrText.split('\\n');\n  const newRow = Array(12).fill(&quot;&quot;); \/\/ Create an empty array for 12 columns\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #66D9EF; font-style: italic\">function<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #A6E22E\">appendToSheet<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #FD971F; font-style: italic\">sheet<\/span><span style=\"color: #F8F8F2\">, <\/span><span style=\"color: #FD971F; font-style: italic\">ocrText<\/span><span style=\"color: #F8F8F2\">) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> rows <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> ocrText.<\/span><span style=\"color: #A6E22E\">split<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&#39;<\/span><span style=\"color: #AE81FF\">\\n<\/span><span style=\"color: #E6DB74\">&#39;<\/span><span style=\"color: #F8F8F2\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> newRow <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #A6E22E\">Array<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #AE81FF\">12<\/span><span style=\"color: #F8F8F2\">).<\/span><span style=\"color: #A6E22E\">fill<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;&quot;<\/span><span style=\"color: #F8F8F2\">); <\/span><span style=\"color: #88846F\">\/\/ Create an empty array for 12 columns<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list u-mb-ctrl u-mb-40\">\n<li><strong><code>rows = ocrText.split('\\n')<\/code><\/strong>:<br>Splits the text obtained from the OCR into an array of strings, using line breaks (<code>\\n<\/code>) as the delimiter.<br>Each line of text becomes an individual element in the array.<\/li>\n\n\n\n<li><strong><code>newRow = Array(12).fill(\"\")<\/code><\/strong>:<br>Creates an empty array with 12 elements, each initialized as an empty string (<code>\"\"<\/code>).<br>This array corresponds to the 12 columns in the spreadsheet, ensuring the data aligns correctly with the intended columns.<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"  sheet.appendRow([ocrText]);\n\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F8F8F2\">  sheet.<\/span><span style=\"color: #A6E22E\">appendRow<\/span><span style=\"color: #F8F8F2\">([ocrText]);<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list u-mb-ctrl u-mb-40\">\n<li><strong><code>sheet.appendRow([ocrText])<\/code><\/strong>:<br>Adds the entire extracted text as a single row to the spreadsheet for debugging purposes.<br>This allows you to review the raw OCR output later and verify the accuracy of the text extraction.<br>By saving the full OCR result in one row, it becomes easier to track and debug the processing of each file.<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"  rows.forEach(row =&gt; {\n    if (row.includes(&quot;Name&quot;)) {\n      newRow[0] = row.split(&quot;:&quot;)[1]?.trim() || &quot;&quot;;\n    } else if (row.includes(&quot;Company&quot;)) {\n      newRow[1] = row.split(&quot;:&quot;)[1]?.trim() || &quot;&quot;;\n    }\n    \/\/ Add more conditions for other fields as needed\n  });\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F8F8F2\">  rows.<\/span><span style=\"color: #A6E22E\">forEach<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #FD971F; font-style: italic\">row<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #66D9EF; font-style: italic\">=&gt;<\/span><span style=\"color: #F8F8F2\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #F92672\">if<\/span><span style=\"color: #F8F8F2\"> (row.<\/span><span style=\"color: #A6E22E\">includes<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;Name&quot;<\/span><span style=\"color: #F8F8F2\">)) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      newRow[<\/span><span style=\"color: #AE81FF\">0<\/span><span style=\"color: #F8F8F2\">] <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> row.<\/span><span style=\"color: #A6E22E\">split<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;:&quot;<\/span><span style=\"color: #F8F8F2\">)[<\/span><span style=\"color: #AE81FF\">1<\/span><span style=\"color: #F8F8F2\">]?.<\/span><span style=\"color: #A6E22E\">trim<\/span><span style=\"color: #F8F8F2\">() <\/span><span style=\"color: #F92672\">||<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;&quot;<\/span><span style=\"color: #F8F8F2\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    } <\/span><span style=\"color: #F92672\">else<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">if<\/span><span style=\"color: #F8F8F2\"> (row.<\/span><span style=\"color: #A6E22E\">includes<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;Company&quot;<\/span><span style=\"color: #F8F8F2\">)) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      newRow[<\/span><span style=\"color: #AE81FF\">1<\/span><span style=\"color: #F8F8F2\">] <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> row.<\/span><span style=\"color: #A6E22E\">split<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;:&quot;<\/span><span style=\"color: #F8F8F2\">)[<\/span><span style=\"color: #AE81FF\">1<\/span><span style=\"color: #F8F8F2\">]?.<\/span><span style=\"color: #A6E22E\">trim<\/span><span style=\"color: #F8F8F2\">() <\/span><span style=\"color: #F92672\">||<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;&quot;<\/span><span style=\"color: #F8F8F2\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #88846F\">\/\/ Add more conditions for other fields as needed<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  });<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list u-mb-ctrl u-mb-40\">\n<li><strong><code>rows.forEach(row => {...})<\/code><\/strong>:<\/li>\n\n\n\n<li>Iterates through each line of the OCR result (<code>rows<\/code>), searching for specific keywords (e.g., <code>\"Name\"<\/code>, <code>\"Company\"<\/code>) and extracting the corresponding data.<\/li>\n\n\n\n<li><code>row.split(\":\")[1]?.trim() || \"\"<\/code>:<br>Splits the line into two parts using the colon (<code>:<\/code>) as the delimiter.<\/li>\n\n\n\n<li><code>?.<\/code>: Uses optional chaining to safely access the second part of the split, avoiding errors if the colon is missing.\u3002<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"  if (newRow.some(cell =&gt; cell !== &quot;&quot;)) {\n    sheet.appendRow(newRow);\n  }\n}\n\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #F92672\">if<\/span><span style=\"color: #F8F8F2\"> (newRow.<\/span><span style=\"color: #A6E22E\">some<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #FD971F; font-style: italic\">cell<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #66D9EF; font-style: italic\">=&gt;<\/span><span style=\"color: #F8F8F2\"> cell <\/span><span style=\"color: #F92672\">!==<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;&quot;<\/span><span style=\"color: #F8F8F2\">)) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    sheet.<\/span><span style=\"color: #A6E22E\">appendRow<\/span><span style=\"color: #F8F8F2\">(newRow);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">}<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>newRow.some(cell => cell !== \"\")<\/code><\/strong>:<br>This checks whether the <code>newRow<\/code> array contains at least one non-empty value.<br>If any cell in the array is not empty, it indicates that relevant data was extracted.<br>In such cases, the function proceeds to add the <code>newRow<\/code> to the spreadsheet as a new row using <strong><code>sheet.appendRow(newRow)<\/code><\/strong>.<\/li>\n<\/ul>\n<\/dd>\n<\/dl>\n<\/div><\/details>\n<\/div>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\"><strong>Input the Folder ID into the Script<\/strong><\/div><div class=\"swell-block-step__body\">\n<p>In the second line of the script, replace the following part:<br><code>const folderId = \"Insert the folder ID for the business cards here\";<\/code><br>with the folder ID of the directory where the business card images are stored.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<p>If your sheet name is <strong>Business Cards<\/strong>, the line should be updated as:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro u-mb-ctrl u-mb-30\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"const folderId = &quot;Business Cards&quot;;\n\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> folderId <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;Business Cards&quot;<\/span><span style=\"color: #F8F8F2\">;<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<div class=\"swell-block-capbox cap_box is-style-onborder_ttl\" data-colset=\"col1\"><div class=\"cap_box_ttl\"><span><strong><span class=\"swl-fz u-fz-l\">How to Get a Folder ID<\/span><\/strong><\/span><\/div><div class=\"cap_box_content\"><div class=\"wp-block-image u-mb-ctrl u-mb-40\">\n<figure class=\"alignleft size-large is-resized\"><img decoding=\"async\" width=\"1024\" height=\"658\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/8907f2e41a2abab1e955dce90e76a803-1024x658.png\" alt=\"\" class=\"wp-image-17275\" style=\"width:595px;height:auto\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/8907f2e41a2abab1e955dce90e76a803-1024x658.png 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/8907f2e41a2abab1e955dce90e76a803-300x193.png 300w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/8907f2e41a2abab1e955dce90e76a803-768x494.png 768w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/8907f2e41a2abab1e955dce90e76a803.png 1287w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>Open the target folder in Google Drive (e.g., <strong>Business Cards<\/strong>).<\/p>\n\n\n\n<p>While the folder is open, look at the URL displayed in your browser&#8217;s address bar.<\/p>\n\n\n\n<p>The series of alphanumeric characters following <code>\"folders\/\"<\/code> in the URL is the folder ID.<\/p>\n<\/div><\/div>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\"><strong>Enter the Sheet Name into the Script<\/strong><\/div><div class=\"swell-block-step__body\"><div class=\"wp-block-image u-mb-ctrl u-mb-30\">\n<figure class=\"alignleft size-full is-resized\"><img decoding=\"async\" width=\"432\" height=\"230\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/10\/image-82.png\" alt=\"\" class=\"wp-image-15345\" style=\"width:282px;height:auto\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/10\/image-82.png 432w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/10\/image-82-300x160.png 300w\" sizes=\"(max-width: 432px) 100vw, 432px\" \/><\/figure>\n<\/div>\n\n\n<p>In line 7 of the script, replace the following part:<br><code>const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(\"Insert sheet name here\");<\/code><br>with the name of the sheet in your Google Spreadsheet.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<p>If your sheet name is <strong>BizCards<\/strong>, the line should be updated as:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"javascriptCopyEditconst sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(&quot;BizCards&quot;);\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F8F8F2\">javascriptCopyEditconst sheet <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> SpreadsheetApp.<\/span><span style=\"color: #A6E22E\">getActiveSpreadsheet<\/span><span style=\"color: #F8F8F2\">().<\/span><span style=\"color: #A6E22E\">getSheetByName<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;BizCards&quot;<\/span><span style=\"color: #F8F8F2\">);<\/span><\/span><\/code><\/pre><\/div>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\"><strong>Save the Script<\/strong><\/div><div class=\"swell-block-step__body\">\n<figure class=\"wp-block-image size-large u-mb-ctrl u-mb-40\"><img decoding=\"async\" width=\"1024\" height=\"388\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-100-1024x388.png\" alt=\"\" class=\"wp-image-17276\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-100-1024x388.png 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-100-300x114.png 300w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-100-768x291.png 768w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-100-1536x582.png 1536w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-100.png 1594w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Once you&#8217;ve written the code, save it with an appropriate name.<\/p>\n\n\n\n<p>Example: BizCards<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\">Run the Script<\/div><div class=\"swell-block-step__body\">\n<figure class=\"wp-block-image size-large u-mb-ctrl u-mb-40\"><img decoding=\"async\" width=\"1024\" height=\"388\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-101-1024x388.png\" alt=\"\" class=\"wp-image-17277\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-101-1024x388.png 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-101-300x114.png 300w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-101-768x291.png 768w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-101-1536x582.png 1536w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-101.png 1594w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"u-mb-ctrl u-mb-40\">Execute the script to process the business card images and transfer the extracted information to the Google Spreadsheet.<\/p>\n\n\n\n<div class=\"wp-block-group is-style-big_icon_memo u-mb-ctrl u-mb-60\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<p>If you&#8217;re running the script for the first time, you need to authorize it.<\/p>\n\n\n\n<p><strong>Therefore, press &#8220;<strong>Review Permissions.<\/strong>&#8220;<\/strong><\/p>\n\n\n<div class=\"wp-block-image u-mb-ctrl u-mb-50\">\n<figure class=\"alignleft size-full\"><img decoding=\"async\" width=\"882\" height=\"345\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/image-79.png\" alt=\"\" class=\"wp-image-15938\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/image-79.png 882w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/image-79-300x117.png 300w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/image-79-768x300.png 768w\" sizes=\"(max-width: 882px) 100vw, 882px\" \/><\/figure>\n<\/div>\n\n\n<div class=\"swell-block-accordion\">\n<details class=\"swell-block-accordion__item\" data-swl-acc=\"wrapper\"><summary class=\"swell-block-accordion__title\" data-swl-acc=\"header\"><span class=\"swell-block-accordion__label\">Detailed Authorization Steps<\/span><span class=\"swell-block-accordion__icon c-switchIconBtn\" data-swl-acc=\"icon\" aria-hidden=\"true\" data-opened=\"false\"><i class=\"__icon--closed icon-caret-down\"><\/i><i class=\"__icon--opened icon-caret-up\"><\/i><\/span><\/summary><div class=\"swell-block-accordion__body\" data-swl-acc=\"body\">\n<p><strong>Press &#8220;Advanced.&#8221;<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full u-mb-ctrl u-mb-50\"><img decoding=\"async\" width=\"1272\" height=\"688\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/188993dfac23ed4b35c326d75de2796d.jpg\" alt=\"\" class=\"wp-image-15939\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/188993dfac23ed4b35c326d75de2796d.jpg 1272w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/188993dfac23ed4b35c326d75de2796d-300x162.jpg 300w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/188993dfac23ed4b35c326d75de2796d-1024x554.jpg 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/188993dfac23ed4b35c326d75de2796d-768x415.jpg 768w\" sizes=\"(max-width: 1272px) 100vw, 1272px\" \/><\/figure>\n\n\n\n\n\n\n\n<p><strong>Press &#8220;Go to Untitled project (Unsafe).&#8221;<\/strong><\/p>\n\n\n<div class=\"wp-block-image u-mb-ctrl u-mb-50\">\n<figure class=\"alignleft size-full\"><img decoding=\"async\" width=\"1305\" height=\"893\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/b7775751f92380510b389302eaafe1b9.jpg\" alt=\"\" class=\"wp-image-15940\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/b7775751f92380510b389302eaafe1b9.jpg 1305w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/b7775751f92380510b389302eaafe1b9-300x205.jpg 300w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/b7775751f92380510b389302eaafe1b9-1024x701.jpg 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/b7775751f92380510b389302eaafe1b9-768x526.jpg 768w\" sizes=\"(max-width: 1305px) 100vw, 1305px\" \/><\/figure>\n<\/div>\n\n\n<p><strong>After that, press &#8220;Allow.&#8221;<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft size-full is-resized\"><img decoding=\"async\" width=\"955\" height=\"543\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/7ebb34b4d2c42fa532ad1c35c1ec1049.jpg\" alt=\"\" class=\"wp-image-15941\" style=\"width:566px;height:auto\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/7ebb34b4d2c42fa532ad1c35c1ec1049.jpg 955w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/7ebb34b4d2c42fa532ad1c35c1ec1049-300x171.jpg 300w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/7ebb34b4d2c42fa532ad1c35c1ec1049-768x437.jpg 768w\" sizes=\"(max-width: 955px) 100vw, 955px\" \/><\/figure>\n<\/div>\n\n\n\n<\/div><\/details>\n<\/div>\n<\/div><\/div>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\"><strong>Verify That Business Card Information Has Been Transferred to the Spreadsheet<\/strong><\/div><div class=\"swell-block-step__body\">\n<figure class=\"wp-block-image size-large u-mb-ctrl u-mb-40\"><img decoding=\"async\" width=\"1024\" height=\"554\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-103-1024x554.png\" alt=\"\" class=\"wp-image-17279\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-103-1024x554.png 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-103-300x162.png 300w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-103-768x416.png 768w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-103.png 1120w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>With this script, the extracted information from the business cards will be transferred to <strong>Column A<\/strong> in the spreadsheet.<\/p>\n\n\n\n<p>In the next article, we will use the <strong>ChatGPT API<\/strong> to organize this information into specific fields (e.g., company name, department, name).<\/p>\n\n\n\n<p>Additionally, the processed business card images will be moved to the <strong>&#8220;Processed&#8221;<\/strong> folder.<\/p>\n<\/div><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading u-mb-ctrl u-mb-30\">Notes on Script Execution<\/h2>\n\n\n\n<p>Google Apps Script  has a maximum execution time of <strong>6 minutes<\/strong>. If the script exceeds this limit, a timeout error will occur.<\/p>\n\n\n\n<p class=\"u-mb-ctrl u-mb-60\">To avoid issues, it\u2019s recommended to start by processing a smaller batch of images (around <strong>10 to 15 images<\/strong>) to gauge how long the process takes. This approach ensures a smoother execution and helps identify any potential bottlenecks.<\/p>\n\n\n\n<h2 class=\"wp-block-heading u-mb-ctrl u-mb-40\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>In this article, we demonstrated how to use <strong>Google Apps Script <\/strong>and the <strong>Google Vision API<\/strong> to automatically input business card data into a Google Spreadsheet.<\/p>\n\n\n\n<p>By automating this process, you can significantly reduce the time and effort required for manual data entry.<\/p>\n\n\n\n<p class=\"u-mb-ctrl u-mb-50\">In the next article, we will explore how to utilize the <strong>ChatGPT API<\/strong> to organize the extracted business card information into specific fields such as company name, department, and name.<\/p>\n\n\n<div class=\"swell-block-postLink\">\t\t\t<div class=\"p-blogCard -internal\" data-type=\"type1\" data-onclick=\"clickLink\">\n\t\t\t\t<div class=\"p-blogCard__inner\">\n\t\t\t\t\t<span class=\"p-blogCard__caption\">\u3042\u308f\u305b\u3066\u8aad\u307f\u305f\u3044<\/span>\n\t\t\t\t\t<div class=\"p-blogCard__thumb c-postThumb\"><figure class=\"c-postThumb__figure\"><img decoding=\"async\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/10\/d1026e539cdfd7cba3c88fa8348bb364-300x158.png\" alt=\"\" class=\"c-postThumb__img u-obf-cover\" width=\"320\" height=\"180\"><\/figure><\/div>\t\t\t\t\t<div class=\"p-blogCard__body\">\n\t\t\t\t\t\t<a class=\"p-blogCard__title\" href=\"https:\/\/84office.jp\/classification-chatgpt-googlesheets\/\">ChatGPT API\u3067\u540d\u523a\u30c7\u30fc\u30bf\u3092\u52b9\u7387\u7684\u306b\u5206\u985e\u3059\u308b\u65b9\u6cd5 \uff0d \u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u00d7ChatGPT\u6d3b\u7528<\/a>\n\t\t\t\t\t\t<span class=\"p-blogCard__excerpt\">\u3053\u306e\u8a18\u4e8b\u3092\u304a\u3059\u3059\u3081\u306e\u65b9 \u624b\u52d5\u3067\u306e\u540d\u523a\u60c5\u5831\u306e\u5165\u529b\u306b\u6642\u9593\u304c\u304b\u304b\u3063\u3066\u3044\u308b\u65b9 \u540d\u523a\u30c7\u30fc\u30bf\u5165\u529b\u3092\u81ea\u52d5\u5316\u3057\u3066\u696d\u52d9\u3092\u52b9\u7387\u5316\u3057\u305f\u3044\u65b9 \u524d\u56de\u306e\u8a18\u4e8b\u3067\u3001\u540d\u523a\u306e\u30c7\u30fc\u30bf\u3092OCR\uff08\u753b\u50cf\u304b\u3089&#8230;<\/span>\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\n<div class=\"p-postListWrap\"><ul class=\"p-postList -type-card -pc-col3 -sp-col1\"><li class=\"p-postList__item\">\n\t<a href=\"https:\/\/84office.jp\/en\/google-calendar-free-time-template\/\" class=\"p-postList__link\">\n\t\t<div class=\"p-postList__thumb c-postThumb\">\n\t<figure class=\"c-postThumb__figure\">\n\t\t<img decoding=\"async\" width=\"1024\" height=\"538\"  src=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/07\/ce7cc8b37e59afe6317fb52e1264cdbb-1024x538.jpg\" alt=\"\" class=\"c-postThumb__img u-obf-cover\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/07\/ce7cc8b37e59afe6317fb52e1264cdbb-1024x538.jpg 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/07\/ce7cc8b37e59afe6317fb52e1264cdbb-300x158.jpg 300w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/07\/ce7cc8b37e59afe6317fb52e1264cdbb-768x403.jpg 768w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/07\/ce7cc8b37e59afe6317fb52e1264cdbb.jpg 1200w\" sizes=\"auto, (min-width: 960px) 400px, 100vw\" loading=\"lazy\" >\t<\/figure>\n\t\t\t<span class=\"c-postThumb__cat icon-folder\" data-cat-id=\"12\">Google Sheets<\/span>\n\t<\/div>\n\t\t\t\t\t<div class=\"p-postList__body\">\n\t\t\t\t<h2 class=\"p-postList__title\">Google Calendar Free Time Finder Template\uff5cGoogle Sheets \u00d7 Apps Script<\/h2>\t\t\t\t\t\t\t\t<div class=\"p-postList__meta\">\n\t\t\t\t\t<div class=\"p-postList__times c-postTimes u-thin\">\n\t<time class=\"c-postTimes__posted icon-posted\" datetime=\"2025-07-25\" aria-label=\"\u516c\u958b\u65e5\">2025\u5e747\u670825\u65e5<\/time><\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t\t<\/a>\n<\/li>\n<li class=\"p-postList__item\">\n\t<a href=\"https:\/\/84office.jp\/en\/google-calendar-free-time-extraction\/\" class=\"p-postList__link\">\n\t\t<div class=\"p-postList__thumb c-postThumb\">\n\t<figure class=\"c-postThumb__figure\">\n\t\t<img decoding=\"async\" width=\"1024\" height=\"538\"  src=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/07\/44f75ff8829b781f2ffdba1b6396054f-1024x538.jpg\" alt=\"\" class=\"c-postThumb__img u-obf-cover\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/07\/44f75ff8829b781f2ffdba1b6396054f-1024x538.jpg 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/07\/44f75ff8829b781f2ffdba1b6396054f-300x158.jpg 300w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/07\/44f75ff8829b781f2ffdba1b6396054f-768x403.jpg 768w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/07\/44f75ff8829b781f2ffdba1b6396054f.jpg 1200w\" sizes=\"auto, (min-width: 960px) 400px, 100vw\" loading=\"lazy\" >\t<\/figure>\n\t\t\t<span class=\"c-postThumb__cat icon-folder\" data-cat-id=\"12\">Google Sheets<\/span>\n\t<\/div>\n\t\t\t\t\t<div class=\"p-postList__body\">\n\t\t\t\t<h2 class=\"p-postList__title\">How to Find Common Free Time in Google Calendar: Manage Shared Schedules with Google Apps Script<\/h2>\t\t\t\t\t\t\t\t<div class=\"p-postList__meta\">\n\t\t\t\t\t<div class=\"p-postList__times c-postTimes u-thin\">\n\t<time class=\"c-postTimes__posted icon-posted\" datetime=\"2025-07-24\" aria-label=\"\u516c\u958b\u65e5\">2025\u5e747\u670824\u65e5<\/time><\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t\t<\/a>\n<\/li>\n<li class=\"p-postList__item\">\n\t<a href=\"https:\/\/84office.jp\/en\/google-calendar-to-sheet-template\/\" class=\"p-postList__link\">\n\t\t<div class=\"p-postList__thumb c-postThumb\">\n\t<figure class=\"c-postThumb__figure\">\n\t\t<img decoding=\"async\" width=\"1024\" height=\"538\"  src=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/07\/ab88c0708887b99cf51ee963a109a8c1-1024x538.jpg\" alt=\"\" class=\"c-postThumb__img u-obf-cover\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/07\/ab88c0708887b99cf51ee963a109a8c1-1024x538.jpg 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/07\/ab88c0708887b99cf51ee963a109a8c1-300x158.jpg 300w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/07\/ab88c0708887b99cf51ee963a109a8c1-768x403.jpg 768w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/07\/ab88c0708887b99cf51ee963a109a8c1.jpg 1200w\" sizes=\"auto, (min-width: 960px) 400px, 100vw\" loading=\"lazy\" >\t<\/figure>\n\t\t\t<span class=\"c-postThumb__cat icon-folder\" data-cat-id=\"12\">Google Sheets<\/span>\n\t<\/div>\n\t\t\t\t\t<div class=\"p-postList__body\">\n\t\t\t\t<h2 class=\"p-postList__title\">Ready-to-Use Google Calendar to Sheets Export Template| Google Sheets &amp; Apps Script<\/h2>\t\t\t\t\t\t\t\t<div class=\"p-postList__meta\">\n\t\t\t\t\t<div class=\"p-postList__times c-postTimes u-thin\">\n\t<time class=\"c-postTimes__posted icon-posted\" datetime=\"2025-07-23\" aria-label=\"\u516c\u958b\u65e5\">2025\u5e747\u670823\u65e5<\/time><\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t\t<\/a>\n<\/li>\n<\/ul><\/div>\n\n\n<p class=\"is-style-emboss_box has-swl-pale-02-background-color has-background\">Our company offers support for improving work efficiency through the use of Google Apps Script. <br>If you need assistance with Google Apps Script customization or error resolution, please feel free to contact us. <br>We are fully committed to supporting your business improvements.<br><br><a href=\"https:\/\/84office.jp\/contact\/\">Contact us here<br><\/a><\/p>\n\n\n\n<script src=\"https:\/\/codoc.jp\/js\/cms.js\" data-css=\"rainbow\" data-usercode=\"pQLZofrBiA\" charset=\"UTF-8\" defer><\/script>\n <div id=\"codoc-entry-9lNr9PuMXQ\" class=\"codoc-entries\" data-without-body=\"1\" data-support-button-text=\"Support with a Tip\" data-support-message=\"We will keep offering tools and information to boost work efficiency. Your support helps us provide even better content.\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Struggling to manage a growing pile of business cards? Keeping track of paper business cards can be a hassle.  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":17281,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","_locale":"en_US","_original_post":"https:\/\/84office.jp\/?p=15336","footnotes":""},"categories":[12],"tags":[],"class_list":["post-17265","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-12","en-US"],"_links":{"self":[{"href":"https:\/\/84office.jp\/wp-json\/wp\/v2\/posts\/17265","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/84office.jp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/84office.jp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/84office.jp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/84office.jp\/wp-json\/wp\/v2\/comments?post=17265"}],"version-history":[{"count":2,"href":"https:\/\/84office.jp\/wp-json\/wp\/v2\/posts\/17265\/revisions"}],"predecessor-version":[{"id":17280,"href":"https:\/\/84office.jp\/wp-json\/wp\/v2\/posts\/17265\/revisions\/17280"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/84office.jp\/wp-json\/wp\/v2\/media\/17281"}],"wp:attachment":[{"href":"https:\/\/84office.jp\/wp-json\/wp\/v2\/media?parent=17265"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/84office.jp\/wp-json\/wp\/v2\/categories?post=17265"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/84office.jp\/wp-json\/wp\/v2\/tags?post=17265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}