Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>OK, got it. You can use the AppleScript given below inside an Automator workflow like this:</p> <p><img src="https://i.imgur.com/wiPxd.png" alt="Automator workflow"></p> <p>For every <strong>selected</strong> file in the Finder, if its extension is in <code>ext_list</code>, it will be moved to the Trash, and so will all other files of the same name in the same folder whose extension is one of those in <code>also_these_extensions</code>.</p> <p>It can be useful, e.g. also for cleaning a folder with auxiliary LaTeX files: just put <code>"tex"</code> into <code>ext_list</code> and all the other extensions (such as <code>"aux", "dvi", "log"</code>) into <code>also_these_extensions</code>.</p> <p>The selected files don't need to be inside the same folder; you can also select several items in a Spotlight search results window.</p> <pre><code>on run {input, parameters} -- for every item having one of these extensions: set ext_list to {"dng"} -- also process items with same name but these extensions: set other_ext_list to {"xmp"} tell application "Finder" set the_delete_list to {} set delete_list to a reference to the_delete_list -- populate list of items to delete repeat with the_item in input set the_item to (the_item as alias) if name extension of the_item is in ext_list then copy the_item to the end of delete_list set parent_folder to (container of the_item) as alias as text set item_name to text 1 thru ((length of (the_item's name as text)) - (length of (the_item's name extension as text))) of (the_item's name as text) repeat with ext in other_ext_list try copy ((parent_folder &amp; item_name &amp; ext) as alias) to the end of delete_list end try end repeat end if end repeat -- delete the items, show info dialog move the_delete_list to the trash display dialog "Moved " &amp; (length of the_delete_list) &amp; " files to the Trash." buttons {"OK"} end tell end run </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload