{"id":88,"date":"2016-04-30T14:58:02","date_gmt":"2016-04-30T14:58:02","guid":{"rendered":"http:\/\/gearmage.com\/blog\/?p=88"},"modified":"2026-11-25T20:16:20","modified_gmt":"2026-11-25T20:16:20","slug":"email-actions-unzip-convert-pdf-run-script","status":"publish","type":"post","link":"https:\/\/gearmage.com\/blog\/email-actions-unzip-convert-pdf-run-script\/","title":{"rendered":"Email actions: unzip an attachment, convert to PDF, decrypt a PDF and run a script"},"content":{"rendered":"\n<p>This post shows how to set up a rule that unzips an email attachment, converts each file inside to PDF (or removes a PDF&#8217;s password), and then runs a script on the result. It is written for version 4.0.<\/p>\n<p>Which edition you need:<\/p>\n<ul>\n<li><strong>Unzip<\/strong>, <strong>Run a script<\/strong> and <strong>Run a command line<\/strong> need <strong><a href=\"https:\/\/gearmage.com\/buymaildownloader.html#plan-server\">PRO Rules Server<\/a><\/strong>.<\/li>\n<li><strong>Convert documents<\/strong> is in <strong><a href=\"https:\/\/gearmage.com\/buymaildownloader.html#plan-client\">PRO Rules Client<\/a><\/strong> and up. <a href=\"https:\/\/gearmage.com\/buymaildownloader.html#plan-client\">PRO Rules Client<\/a> converts to PDF only, which includes removing a PDF&#8217;s password. <a href=\"https:\/\/gearmage.com\/buymaildownloader.html#plan-server\">PRO Rules Server<\/a> also converts to other formats, such as Word or multi-page TIFF.<\/li>\n<\/ul>\n<p>You start from a rule with its conditions and its <strong>Save<\/strong> part set up, for example for the emails from acme.example, saved to <code>\\\\fileserver\\Finance\\Invoices<\/code>. New to rules? See <a href=\"https:\/\/gearmage.com\/blog\/save-emails-and-attachments-to-folders\/\">save emails and attachments to folders<\/a>.<\/p>\n<p>Steps work on the saved files. To run them on the email itself too, set <strong>What to save<\/strong> to <strong>The email and its attachments<\/strong>: the email is then saved as an .eml file, and <strong>Convert documents<\/strong> can turn it into a PDF.<\/p>\n\n<h2>1. Unzip the attachment<\/h2>\n<p>In the Rule Editor, click <strong>Add a step&#8230;<\/strong>, find <strong>Unzip<\/strong> (type &#8220;zip&#8221; in the search box) and click <strong>Add<\/strong>. It goes under <strong>Then<\/strong>. Its options:<\/p>\n<ul>\n<li><strong>Only these files:<\/strong> one file name or extension per line, such as <code>.docx<\/code> and <code>.pdf<\/code>. Leave it empty to unzip every file.<\/li>\n<li><strong>Delete the zip file after unzipping it<\/strong>, if you only want the files inside.<\/li>\n<li><strong>Keep the folders inside the zip<\/strong>, to keep the zip&#8217;s own folders.<\/li>\n<\/ul>\n\n<figure><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/gearmage.com\/assets\/images\/4.0-unzip.jpg?w=840&#038;ssl=1\" alt=\"The Rule Editor with an Unzip step under Then, and its options: Delete the zip file after unzipping it, Only these files and Keep the folders inside the zip\"><figcaption>The Unzip step and its options.<\/figcaption><\/figure>\n\n<h2>2. Convert each unzipped file, inside Unzip<\/h2>\n<p>Steps inside the Unzip step run for each file it unzips. To add one there:<\/p>\n<ol>\n<li>Select <strong>Unzip<\/strong> in the rule&#8217;s outline.<\/li>\n<li>Click <strong>Add a step&#8230;<\/strong> and, in the <strong>Add it:<\/strong> box, choose <strong>Inside &#8220;Unzip&#8221;<\/strong>.<\/li>\n<li>Pick <strong>Convert documents<\/strong> and click <strong>Add<\/strong>.<\/li>\n<\/ol>\n<p>In the <strong>Convert documents<\/strong> step, click <strong>Add&#8230;<\/strong> to add a conversion. In the <strong>Conversion<\/strong> window, choose what is converted in <strong>From:<\/strong>, choose pdf in <strong>To:<\/strong>, and set the result&#8217;s name in <strong>Save as:<\/strong>, such as <code>{SAVE_PATH}\\{FILENAME}.pdf<\/code>. Add one conversion for each kind of file, for example Word files and pictures. Tick <strong>Delete the originals after converting them<\/strong> if you only want the PDFs.<\/p>\n\n<figure><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/gearmage.com\/assets\/images\/4.0-dialog-conversionengine.jpg?w=840&#038;ssl=1\" alt=\"The Conversion window: From, To pdf, Save as with fields, Run the rules on the result, Convert with Free libraries, and the options for pictures and for the PDF made\"><figcaption>The Conversion window of the Convert documents step.<\/figcaption><\/figure>\n\n<h3>Decrypt a PDF<\/h3>\n<p>Do the files arrive as password-protected PDFs? Add a conversion from PDF to pdf, with a new name in <strong>Save as:<\/strong> such as <code>{SAVE_PATH}\\{FILENAME}_open.pdf<\/code>. Under <strong>A PDF converted<\/strong>, type the password in <strong>Decryption password:<\/strong>. The PDF it saves has no password. <strong>Remove the restrictions<\/strong> also drops limits such as no printing or no copying. It works the other way too: <strong>Encrypt the PDF<\/strong>, under <strong>The PDF made<\/strong>, adds a password to the PDFs you make.<\/p>\n<figure><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/gearmage.com\/assets\/images\/4.0-conversion-decrypt.jpg?w=840&#038;ssl=1\" alt=\"The Conversion window: from PDF to pdf, saved as the file name with _open, and under A PDF converted a masked Decryption password\"><figcaption>A PDF converted: the password opens a protected PDF, and the copy is saved without it.<\/figcaption><\/figure>\n\n<h2>3. Run a script on the converted file, inside Convert documents<\/h2>\n<p>Now select <strong>Convert documents<\/strong>, click <strong>Add a step&#8230;<\/strong>, choose <strong>Inside &#8220;Convert documents&#8221;<\/strong> in the <strong>Add it:<\/strong> box, and pick a step from <strong>Programs<\/strong>:<\/p>\n<ul>\n<li><strong>Run a script<\/strong> runs a script with the fields and waits for it to finish. Set the <strong>Program:<\/strong> (a .bat or .exe file, or <code>powershell.exe<\/code> for a PowerShell script), its <strong>Arguments:<\/strong> and a <strong>Timeout (seconds):<\/strong>. What it prints goes to the program&#8217;s logs.<\/li>\n<li><strong>Run a command line<\/strong> runs a program or a .bat file with the fields: set the <strong>Command:<\/strong> and its <strong>Arguments:<\/strong>.<\/li>\n<\/ul>\n<p>Click <strong>Fields&#8230;<\/strong> to add fields to the arguments. Inside <strong>Convert documents<\/strong>, <code>{SAVE_PATH}<\/code> and <code>{FILENAMEEXT}<\/code> are the converted PDF, not the zip or the file it was made from. For example, with <code>powershell.exe<\/code> as the program, the arguments could be <code>-File \"C:\\Scripts\\ArchiveInvoice.ps1\" \"{SAVE_PATH}\\{FILENAMEEXT}\" \"{EMAIL_FROM}\"<\/code>.<\/p>\n<p><strong>Run:<\/strong> says whether the step runs <strong>For each saved file<\/strong> or <strong>Once per email<\/strong>. Click <strong>Run it once (test)<\/strong> to try it with a sample email&#8217;s values.<\/p>\n\n<figure><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/gearmage.com\/assets\/images\/4.0-run-program.jpg?w=840&#038;ssl=1\" alt=\"The Run a command line step: Command C:\\Tools\\ArchiveInvoice.exe, Arguments with the SUPPLIER, SAVE_PATH and FILENAMEEXT fields, Run For each saved file, and Run it once (test)\"><figcaption>A Run a command line step, with fields in its arguments.<\/figcaption><\/figure>\n\n<h2>The finished rule<\/h2>\n<p>The rule&#8217;s outline now reads:<\/p>\n<ul>\n<li><strong>Then<\/strong>\n<ul>\n<li><strong>Unzip<\/strong>\n<ul>\n<li><strong>Convert documents<\/strong>\n<ul>\n<li><strong>Run a script<\/strong><\/li>\n<\/ul><\/li>\n<\/ul><\/li>\n<\/ul><\/li>\n<\/ul>\n<p>Each zip is unzipped, each file inside is converted to PDF, and the script runs once for each PDF.<\/p>\n<figure><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/gearmage.com\/assets\/images\/4.0-steps-nested-outline.jpg?w=840&#038;ssl=1\" alt=\"The Rule Editor of the rule Acme invoice zips: under Then, Unzip, with Convert documents inside it and Run a script inside that, running powershell.exe with -File and the saved file\"><figcaption>Steps inside steps: Unzip, then Convert documents on each file, then Run a script on each PDF.<\/figcaption><\/figure>\n<p>Click <strong>Test this rule&#8230;<\/strong> to try it on emails you pick. Unzipping and converting are done for real, into a temporary folder, so you can open the PDFs. The script is only described, not run. Then click <strong>Save<\/strong>.<\/p>\n<p>A step can fail, for example when a PDF&#8217;s password is wrong. Steps under <strong>If something fails<\/strong>, such as <strong>Move or copy the email<\/strong> or <strong>Send notification<\/strong>, tell you or set the email aside. The program also tries a failed step again by itself. See <a href=\"https:\/\/gearmage.com\/blog\/nesting-email-rules-and-actions\/\">nesting email rules and actions<\/a>.<\/p>\n\n<h2>More steps for files<\/h2>\n<p>Other steps go well with these: <strong>Convert all files to a single PDF<\/strong>, <strong>Merge PDFs<\/strong>, <strong>Split PDF<\/strong> and <strong>Make PDFs searchable (OCR)<\/strong> (<a href=\"https:\/\/gearmage.com\/buymaildownloader.html#plan-server\">PRO Rules Server<\/a>), and <strong>Upload to cloud<\/strong> or <strong>Copy file<\/strong> (<a href=\"https:\/\/gearmage.com\/buymaildownloader.html#plan-client\">PRO Rules Client<\/a> and up). Need a step that isn&#8217;t there? <a href=\"https:\/\/gearmage.com\/contact.html\">Contact us<\/a> and we&#8217;ll look at it.<\/p>\n\n<p><strong>Try it:<\/strong> <a href=\"https:\/\/gearmage.com\/maildownloader.html\">download Mail Attachment Downloader<\/a> and start with <a href=\"https:\/\/gearmage.com\/buymaildownloader.html#plan-free\">the free edition<\/a>, or <a href=\"https:\/\/gearmage.com\/buymaildownloader.html\">compare the PRO editions<\/a>, each with a 30-day money-back guarantee.<\/p>\n\n<h2>Related<\/h2>\n<ul>\n<li><a href=\"https:\/\/gearmage.com\/maildownloader_pro_features.html#unzip\">Unzip files<\/a><\/li>\n<li><a href=\"https:\/\/gearmage.com\/maildownloader_pro_features.html#convert\">Convert to PDF and 50+ formats<\/a><\/li>\n<li><a href=\"https:\/\/gearmage.com\/maildownloader_pro_features.html#pdf-tools\">PDF tools: merge, split, encrypt and decrypt, OCR<\/a><\/li>\n<li><a href=\"https:\/\/gearmage.com\/maildownloader_pro_features.html#scripts\">Scripts and webhooks<\/a><\/li>\n<li><a href=\"https:\/\/gearmage.com\/emails-to-pdf.html\">Save emails and attachments as PDF<\/a><\/li>\n<li><a href=\"https:\/\/gearmage.com\/blog\/customizing-filenames-or-email-data-using-fields\/\">Fields in file names and steps<\/a><\/li>\n<li>Using version 3.x? See the <a href=\"https:\/\/gearmage.com\/blog\/email-actions-unzip-convert-pdf-run-script-3x\/\">3.x version of this guide<\/a>.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Unzip email attachments, convert or decrypt each file as PDF, then run a script on the result: steps inside steps in Mail Attachment Downloader.<\/p>\n","protected":false},"author":1,"featured_media":314,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[131,4,123,6],"tags":[42,45,105],"class_list":["post-88","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-integrations","category-mad","category-pdf-documents","category-tips","tag-email-automation","tag-email-processing","tag-nesting-actions"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Unzip attachments, convert PDFs, run scripts - Gearmage Blog<\/title>\n<meta name=\"description\" content=\"Unzip email attachments, convert or decrypt each file as PDF, then run a script on the result: steps inside steps in Mail Attachment Downloader.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gearmage.com\/blog\/email-actions-unzip-convert-pdf-run-script\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Unzip attachments, convert PDFs, run scripts - Gearmage Blog\" \/>\n<meta property=\"og:description\" content=\"Unzip email attachments, convert or decrypt each file as PDF, then run a script on the result: steps inside steps in Mail Attachment Downloader.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gearmage.com\/blog\/email-actions-unzip-convert-pdf-run-script\/\" \/>\n<meta property=\"og:site_name\" content=\"Gearmage Blog\" \/>\n<meta property=\"article:published_time\" content=\"2016-04-30T14:58:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-25T20:16:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2017\/06\/pro-bg.jpg?fit=600%2C398&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"600\" \/>\n\t<meta property=\"og:image:height\" content=\"398\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"gearmage\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"gearmage\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/email-actions-unzip-convert-pdf-run-script\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/email-actions-unzip-convert-pdf-run-script\\\/\"},\"author\":{\"name\":\"gearmage\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#\\\/schema\\\/person\\\/c8728645787bff3555b5873b43161652\"},\"headline\":\"Email actions: unzip an attachment, convert to PDF, decrypt a PDF and run a script\",\"datePublished\":\"2016-04-30T14:58:02+00:00\",\"dateModified\":\"2026-11-25T20:16:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/email-actions-unzip-convert-pdf-run-script\\\/\"},\"wordCount\":908,\"publisher\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/email-actions-unzip-convert-pdf-run-script\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/gearmage.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/pro-bg.jpg?fit=600%2C398&ssl=1\",\"keywords\":[\"email automation\",\"email processing\",\"nesting actions\"],\"articleSection\":[\"Integrations and automation\",\"Mail Attachment Downloader\",\"PDF and documents\",\"Tips\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/email-actions-unzip-convert-pdf-run-script\\\/\",\"url\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/email-actions-unzip-convert-pdf-run-script\\\/\",\"name\":\"Unzip attachments, convert PDFs, run scripts - Gearmage Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/email-actions-unzip-convert-pdf-run-script\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/email-actions-unzip-convert-pdf-run-script\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/gearmage.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/pro-bg.jpg?fit=600%2C398&ssl=1\",\"datePublished\":\"2016-04-30T14:58:02+00:00\",\"dateModified\":\"2026-11-25T20:16:20+00:00\",\"description\":\"Unzip email attachments, convert or decrypt each file as PDF, then run a script on the result: steps inside steps in Mail Attachment Downloader.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/email-actions-unzip-convert-pdf-run-script\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gearmage.com\\\/blog\\\/email-actions-unzip-convert-pdf-run-script\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/email-actions-unzip-convert-pdf-run-script\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/gearmage.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/pro-bg.jpg?fit=600%2C398&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/gearmage.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/pro-bg.jpg?fit=600%2C398&ssl=1\",\"width\":600,\"height\":398},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/email-actions-unzip-convert-pdf-run-script\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Email actions: unzip an attachment, convert to PDF, decrypt a PDF and run a script\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/\",\"name\":\"Gearmage Blog\",\"description\":\"Email Processing Tools and Solutions\",\"publisher\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#organization\",\"name\":\"Gearmage\",\"url\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/gearmage.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/02\\\/cropped-cropped-GearMage.jpg?fit=240%2C58&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/gearmage.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/02\\\/cropped-cropped-GearMage.jpg?fit=240%2C58&ssl=1\",\"width\":240,\"height\":58,\"caption\":\"Gearmage\"},\"image\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#\\\/schema\\\/person\\\/c8728645787bff3555b5873b43161652\",\"name\":\"gearmage\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ca0fad01f9a63241bc21d4f1f44befe7c62e4ee3bb268fb1adaadc2e49ed0699?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ca0fad01f9a63241bc21d4f1f44befe7c62e4ee3bb268fb1adaadc2e49ed0699?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ca0fad01f9a63241bc21d4f1f44befe7c62e4ee3bb268fb1adaadc2e49ed0699?s=96&d=mm&r=g\",\"caption\":\"gearmage\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Unzip attachments, convert PDFs, run scripts - Gearmage Blog","description":"Unzip email attachments, convert or decrypt each file as PDF, then run a script on the result: steps inside steps in Mail Attachment Downloader.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/gearmage.com\/blog\/email-actions-unzip-convert-pdf-run-script\/","og_locale":"en_US","og_type":"article","og_title":"Unzip attachments, convert PDFs, run scripts - Gearmage Blog","og_description":"Unzip email attachments, convert or decrypt each file as PDF, then run a script on the result: steps inside steps in Mail Attachment Downloader.","og_url":"https:\/\/gearmage.com\/blog\/email-actions-unzip-convert-pdf-run-script\/","og_site_name":"Gearmage Blog","article_published_time":"2016-04-30T14:58:02+00:00","article_modified_time":"2026-11-25T20:16:20+00:00","og_image":[{"width":600,"height":398,"url":"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2017\/06\/pro-bg.jpg?fit=600%2C398&ssl=1","type":"image\/jpeg"}],"author":"gearmage","twitter_card":"summary_large_image","twitter_misc":{"Written by":"gearmage","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/gearmage.com\/blog\/email-actions-unzip-convert-pdf-run-script\/#article","isPartOf":{"@id":"https:\/\/gearmage.com\/blog\/email-actions-unzip-convert-pdf-run-script\/"},"author":{"name":"gearmage","@id":"https:\/\/gearmage.com\/blog\/#\/schema\/person\/c8728645787bff3555b5873b43161652"},"headline":"Email actions: unzip an attachment, convert to PDF, decrypt a PDF and run a script","datePublished":"2016-04-30T14:58:02+00:00","dateModified":"2026-11-25T20:16:20+00:00","mainEntityOfPage":{"@id":"https:\/\/gearmage.com\/blog\/email-actions-unzip-convert-pdf-run-script\/"},"wordCount":908,"publisher":{"@id":"https:\/\/gearmage.com\/blog\/#organization"},"image":{"@id":"https:\/\/gearmage.com\/blog\/email-actions-unzip-convert-pdf-run-script\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2017\/06\/pro-bg.jpg?fit=600%2C398&ssl=1","keywords":["email automation","email processing","nesting actions"],"articleSection":["Integrations and automation","Mail Attachment Downloader","PDF and documents","Tips"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/gearmage.com\/blog\/email-actions-unzip-convert-pdf-run-script\/","url":"https:\/\/gearmage.com\/blog\/email-actions-unzip-convert-pdf-run-script\/","name":"Unzip attachments, convert PDFs, run scripts - Gearmage Blog","isPartOf":{"@id":"https:\/\/gearmage.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/gearmage.com\/blog\/email-actions-unzip-convert-pdf-run-script\/#primaryimage"},"image":{"@id":"https:\/\/gearmage.com\/blog\/email-actions-unzip-convert-pdf-run-script\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2017\/06\/pro-bg.jpg?fit=600%2C398&ssl=1","datePublished":"2016-04-30T14:58:02+00:00","dateModified":"2026-11-25T20:16:20+00:00","description":"Unzip email attachments, convert or decrypt each file as PDF, then run a script on the result: steps inside steps in Mail Attachment Downloader.","breadcrumb":{"@id":"https:\/\/gearmage.com\/blog\/email-actions-unzip-convert-pdf-run-script\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gearmage.com\/blog\/email-actions-unzip-convert-pdf-run-script\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gearmage.com\/blog\/email-actions-unzip-convert-pdf-run-script\/#primaryimage","url":"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2017\/06\/pro-bg.jpg?fit=600%2C398&ssl=1","contentUrl":"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2017\/06\/pro-bg.jpg?fit=600%2C398&ssl=1","width":600,"height":398},{"@type":"BreadcrumbList","@id":"https:\/\/gearmage.com\/blog\/email-actions-unzip-convert-pdf-run-script\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gearmage.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Email actions: unzip an attachment, convert to PDF, decrypt a PDF and run a script"}]},{"@type":"WebSite","@id":"https:\/\/gearmage.com\/blog\/#website","url":"https:\/\/gearmage.com\/blog\/","name":"Gearmage Blog","description":"Email Processing Tools and Solutions","publisher":{"@id":"https:\/\/gearmage.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gearmage.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/gearmage.com\/blog\/#organization","name":"Gearmage","url":"https:\/\/gearmage.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gearmage.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2016\/02\/cropped-cropped-GearMage.jpg?fit=240%2C58&ssl=1","contentUrl":"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2016\/02\/cropped-cropped-GearMage.jpg?fit=240%2C58&ssl=1","width":240,"height":58,"caption":"Gearmage"},"image":{"@id":"https:\/\/gearmage.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/gearmage.com\/blog\/#\/schema\/person\/c8728645787bff3555b5873b43161652","name":"gearmage","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ca0fad01f9a63241bc21d4f1f44befe7c62e4ee3bb268fb1adaadc2e49ed0699?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ca0fad01f9a63241bc21d4f1f44befe7c62e4ee3bb268fb1adaadc2e49ed0699?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ca0fad01f9a63241bc21d4f1f44befe7c62e4ee3bb268fb1adaadc2e49ed0699?s=96&d=mm&r=g","caption":"gearmage"}}]}},"jetpack-related-posts":[],"jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2017\/06\/pro-bg.jpg?fit=600%2C398&ssl=1","_links":{"self":[{"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/posts\/88","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/comments?post=88"}],"version-history":[{"count":6,"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/posts\/88\/revisions"}],"predecessor-version":[{"id":1410,"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/posts\/88\/revisions\/1410"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/media\/314"}],"wp:attachment":[{"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/media?parent=88"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/categories?post=88"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/tags?post=88"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}