{"id":1215,"date":"2025-06-17T13:50:04","date_gmt":"2025-06-17T11:50:04","guid":{"rendered":"https:\/\/www.homeserver.lu\/?p=1215"},"modified":"2025-06-17T14:08:11","modified_gmt":"2025-06-17T12:08:11","slug":"quick-action-convert-to-m4a","status":"publish","type":"post","link":"https:\/\/www.homeserver.lu\/?p=1215","title":{"rendered":"Quick action: convert to m4a"},"content":{"rendered":"\n<p>If you do not want to keep large WAV or AIFF files on your disk that eat up precious space, you can use Apple&#8217;s <em>Automator<\/em> to write a <em>quick action<\/em> to easily convert these files to m4a.<\/p>\n\n\n\n<p>Open Apple&#8217;s Automator and create a new quick action. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"557\" src=\"https:\/\/www.homeserver.lu\/wp-content\/uploads\/2025\/06\/Quick-Action-m4a-conversion-1024x557.png\" alt=\"\" class=\"wp-image-1216\" srcset=\"https:\/\/www.homeserver.lu\/wp-content\/uploads\/2025\/06\/Quick-Action-m4a-conversion-1024x557.png 1024w, https:\/\/www.homeserver.lu\/wp-content\/uploads\/2025\/06\/Quick-Action-m4a-conversion-300x163.png 300w, https:\/\/www.homeserver.lu\/wp-content\/uploads\/2025\/06\/Quick-Action-m4a-conversion-768x418.png 768w, https:\/\/www.homeserver.lu\/wp-content\/uploads\/2025\/06\/Quick-Action-m4a-conversion-624x339.png 624w, https:\/\/www.homeserver.lu\/wp-content\/uploads\/2025\/06\/Quick-Action-m4a-conversion.png 1122w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Automator: convert audio files to m4a<\/figcaption><\/figure>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>for f in &quot;$@&quot;\ndo\n  afconvert -f m4af -d aac &quot;$f&quot; &quot;${f%.*}.m4a&quot;\ndone\n<\/code><\/pre><\/div>\n\n\n\n<p>You can also have Automator <strong>delete the original file <\/strong>after conversion:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"960\" src=\"https:\/\/www.homeserver.lu\/wp-content\/uploads\/2025\/06\/Quick-Action-m4-con-version-with-deletion-1024x960.png\" alt=\"\" class=\"wp-image-1218\" srcset=\"https:\/\/www.homeserver.lu\/wp-content\/uploads\/2025\/06\/Quick-Action-m4-con-version-with-deletion-1024x960.png 1024w, https:\/\/www.homeserver.lu\/wp-content\/uploads\/2025\/06\/Quick-Action-m4-con-version-with-deletion-300x281.png 300w, https:\/\/www.homeserver.lu\/wp-content\/uploads\/2025\/06\/Quick-Action-m4-con-version-with-deletion-768x720.png 768w, https:\/\/www.homeserver.lu\/wp-content\/uploads\/2025\/06\/Quick-Action-m4-con-version-with-deletion-624x585.png 624w, https:\/\/www.homeserver.lu\/wp-content\/uploads\/2025\/06\/Quick-Action-m4-con-version-with-deletion.png 1124w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Automator: convert audio to m4a and delete original file<\/figcaption><\/figure>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>for f in &quot;$@&quot;\ndo\n  # Convert WAV to M4A\n  afconvert -f m4af -d aac &quot;$f&quot; &quot;${f%.*}.m4a&quot;\n  \n  # Check if conversion succeeded before deleting\n  if [ $? -eq 0 ]; then\n    rm &quot;$f&quot;\n  else\n    echo &quot;Conversion failed for $f, original not deleted.&quot;\n  fi\ndone<\/code><\/pre><\/div>\n\n\n\n<p>These <em>quick actions<\/em> also work on video files (like mp4), in case you are only interested in keeping the audio track of a video file.<\/p>\n\n\n\n<p>The above quick action workflows can be downloaded below:<\/p>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-44078b6a-8266-4932-a169-b86399f55242\" href=\"https:\/\/www.homeserver.lu\/wp-content\/uploads\/2025\/06\/Convert-to-m4a.workflow.zip\">Convert to m4a.workflow<\/a><a href=\"https:\/\/www.homeserver.lu\/wp-content\/uploads\/2025\/06\/Convert-to-m4a.workflow.zip\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-44078b6a-8266-4932-a169-b86399f55242\">Download<\/a><\/div>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-c0a80215-e963-4f09-aa2f-5013f0655b2c\" href=\"https:\/\/www.homeserver.lu\/wp-content\/uploads\/2025\/06\/Convert-to-m4a-and-delete-source.workflow.zip\">Convert to m4a and delete source.workflow<\/a><a href=\"https:\/\/www.homeserver.lu\/wp-content\/uploads\/2025\/06\/Convert-to-m4a-and-delete-source.workflow.zip\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-c0a80215-e963-4f09-aa2f-5013f0655b2c\">Download<\/a><\/div>\n\n\n\n<p>To install the workflows as <em>quick actions<\/em>, you can download the above files, unzip and execute. macOs will then install the workflows. Your macOS security protection still keeps them disabled. You have to enable them in system preferences. Open <em>Login Items &amp; Extensions<\/em>, under <em>Extensions<\/em>, behind the <em>Finder<\/em> line, hit the &#8220;i&#8221; button:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"879\" height=\"1024\" src=\"https:\/\/www.homeserver.lu\/wp-content\/uploads\/2025\/06\/Allow-Extension-879x1024.png\" alt=\"\" class=\"wp-image-1227\" srcset=\"https:\/\/www.homeserver.lu\/wp-content\/uploads\/2025\/06\/Allow-Extension-879x1024.png 879w, https:\/\/www.homeserver.lu\/wp-content\/uploads\/2025\/06\/Allow-Extension-258x300.png 258w, https:\/\/www.homeserver.lu\/wp-content\/uploads\/2025\/06\/Allow-Extension-768x894.png 768w, https:\/\/www.homeserver.lu\/wp-content\/uploads\/2025\/06\/Allow-Extension-1319x1536.png 1319w, https:\/\/www.homeserver.lu\/wp-content\/uploads\/2025\/06\/Allow-Extension-624x727.png 624w, https:\/\/www.homeserver.lu\/wp-content\/uploads\/2025\/06\/Allow-Extension.png 1654w\" sizes=\"auto, (max-width: 879px) 100vw, 879px\" \/><figcaption class=\"wp-element-caption\">macOS system settings: enable the quick action<\/figcaption><\/figure>\n\n\n\n<p>Source: These scripts have been developed with the help of a generative large language model.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you do not want to keep large WAV or AIFF files on your disk that eat up precious space, you can use Apple&#8217;s Automator to write a quick action to easily convert these files to m4a. Open Apple&#8217;s Automator and create a new quick action. You can also have Automator delete the original file [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[53],"tags":[],"class_list":["post-1215","post","type-post","status-publish","format-standard","hentry","category-automator"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/posts\/1215","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1215"}],"version-history":[{"count":11,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/posts\/1215\/revisions"}],"predecessor-version":[{"id":1232,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/posts\/1215\/revisions\/1232"}],"wp:attachment":[{"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}