 
 Use POST-PROCESS-TEMPLATE to further expand template given own logic."
   (setq file (expand-file-name file))
-  ;; "<<fne>>_other_<<e>>" with "/path/file.jpg" -> "'/path/file_other.jpg'"
-  (setq template (replace-regexp-in-string "[[:blank:]]\\(\\(\<\<fne\>\>\\)\\([^ \n]+\\)\\(\<\<e\>\>\\)\\)"
-                                           (format "'%s\\3%s'"
-                                                   (file-name-sans-extension file)
-                                                   (file-name-extension file))
-                                           template nil nil 1))
-  ;; "<<fne>>.gif" with "/path/tmp.txt" -> "'/path/tmp.gif'"
-  (setq template (replace-regexp-in-string "[[:blank:]]\\(\\(\<\<fne\>\>\\)\\([^ \n]+\\)\\([[:blank:]]\\|$\\)\\)"
-                                           (format "'%s\\3'\\4" (file-name-sans-extension file)) template nil nil 1))
-  ;; "<<fne>>" with "/path/tmp.txt" -> "'/path/tmp'"
-  (setq template (replace-regexp-in-string "\\(\<\<fne\>\>\\)"
-                                           (format "'%s'" (file-name-sans-extension file)) template nil nil 1))
-  ;; "<<f>>" with "/path/file.jpg" -> "'/path/file.jpg'"
-  (setq template (replace-regexp-in-string "[[:blank:]]\\(\<\<f\>\>\\)\\([[:blank:]]\\|$\\)"
-                                           (format "'%s'" file)
-                                           template nil nil 1))
-  ;; "<<f>>" with "/path/file.jpg" -> "'/path/file.jpg'"
-  (setq template (replace-regexp-in-string "\\(\<\<f\>\>\\)"
-                                           (format "'%s'" file)
-                                           template nil nil 1))
+  ;; "<<fne>>" with "/path/tmp.txt" -> "/path/tmp"
+  (setq template (replace-regexp-in-string "\\(\<\<fne\>\>\\)" (file-name-sans-extension file) template nil nil 1))
+
+  ;; "<<e>>" with "/path/tmp.txt" -> "txt"
+  (setq template (replace-regexp-in-string "\\(\<\<e\>\>\\)" (file-name-extension file) template nil nil 1))
+
+  ;; "<<f>>" with "/path/file.jpg" -> "/path/file.jpg"
+  (setq template (replace-regexp-in-string "\\(\<\<f\>\>\\)" file template nil nil 1))
   (when post-process-template
     (setq template (funcall post-process-template template file)))
   template)

  "Drop audio from all marked videos."
  (interactive)
  (dwim-shell-command-on-marked-files
   "Drop audio" "ffmpeg -i <<f>> -c copy -an <<fne>>_no_audio.<<e>>"
   :utils "ffmpeg"))

(defun dwim-shell-command-convert-image-to-icns ()

  (interactive)
  (dwim-shell-command-on-marked-files
   "Convert to jpg"
   "convert -verbose '<<f>>' '<<fne>>.jpg'"
   :utils "convert"))

(defun dwim-shell-command-convert-image-to-png ()
