4

When opening multiple .jpg files (or other format) I can use the "Move to Trash" on all but the last one standing?

Here is a example of two images, and if I select one then the Move to Trash works.

single

However if I select all or have only one image showing the Move to Trash is disabled?

multiple

My challenge is that I open a group of screen shots and then review and delete.

Let say I have 50 screen shots and I open 10 of them to work with. The names are

  • Screen Shot 2015-01-19 at 9.14.42 PM
  • Screen Shot 2015-01-19 at 9.14.17 PM

and so on.

Obviously I can not remember the specific name once I close the Preview and now have to find and delete a specific one, since now it is a part of larger group with very "similar" names.

Is there a way to use the Move to Trash on all images including the last one standing.

  • Would switching to Coverflow in Finder (or just using QuickView) to view the files be an option? – nohillside Jan 20 '15 at 7:37
  • @patrix Coverflow is certainly a option. How do you Delete in QuickView? – Ruskes Jan 20 '15 at 7:49
  • 1
    Just pressing Cmd-Backspace while you look at the file AFAIR. – nohillside Jan 20 '15 at 8:19
  • I have update my Answer – markhunte Jan 24 '15 at 16:07
5
+50

You can move those files directly to the Trash.

  1. Select them in Preview

  2. Drag them above the Trash in the Dock

  3. Wait for ~2 seconds

  4. Finder window will appear and you can drop those files.

However you won't be able to empty the Trash without closing the Preview window first (the file is still in use).

| improve this answer | |
  • as simple as that :) – Ruskes Jan 20 '15 at 19:55
  • there you go 100 points for so simple solution. – Ruskes Jan 26 '15 at 19:38
  • @Buscar웃 I'm happy this helped. I'm not doing this for additional points, so Your 100 from comments is also satisfactory ;) – Mateusz Szlosek Jan 28 '15 at 7:08
3

Preview won't allow you to cmd-delete, or "move to trash", or even drag and drop to trash, the last file it has open. This "feature" was introduced in Lion, and you're not the first person to lament it's inclusion online.

The only useful solution I've found is to create an Apple Script Application that deletes any item dragged on to it and put this application in your dock. Here's how:

  1. Open Script Editor (inside the Applications->Utilities folder) and create a new document
  2. Paste in the following code:

    on open thisfile
        tell application "Finder"
            delete file thisfile
        end tell
    end open
    
  3. Choose File-> Export to export your newly created application, give it a name that's useful like delete.app and save it into your applications folder. Make sure to change file format to "Application"

  4. Drag the application into your dock

Voila! Any file you drag onto this application will now be moved to trash. The last item open will still in fact stay open in preview once you delete it but it will have moved to the trash from it's previous location. It's not an ideal solution, but it's a solution.

| improve this answer | |
  • This could be nice way around. – Ruskes Jan 20 '15 at 7:50
  • Sorry for not giving you the reward, but the other solution (just drag to trash) was much simpler, still I will keep yours. – Ruskes Jan 26 '15 at 19:37
  • No problems, even I didn't realise you could drag to the trash and wait a few seconds... – JamiePatt Jan 28 '15 at 2:55
1

If your Preview.app has been made scriptable. (If I remember right Apple may have made it so in later versions, but with no real dictionary)

You can run this Script, Saved in an Run Applescript Action in an Automator Service for Preview.app, no input.

set theDocs to path of (documents of application "Preview")
repeat with i from 1 to number of items in theDocs
    tell application "Finder" to set item i of theDocs to ((item i of theDocs) as POSIX file) as alias

end repeat
tell application "Finder" to delete items of theDocs

I am still looking at improving this as it works well. But it will get ALL open documents. Which each image grouped or not is seen as.

So beware that if you have Preview.app to open in groups or separate windows and more than one window open ALL will be seen and deleted.

Preview.app does not respect the normal understanding of a window. Hence me still working on this


UPDATE:

This (in most cases) should work better. It tries to deal only with the front window and its images.

tell application "Preview"
    set theDocsID to id of window 1
    set theDocsWin to name of (first window whose id is theDocsID)
    try
        set documentCount to word -5 of theDocsWin as number -- the window name has a document count. we can use this repeat for each image.

    on error
        set documentCount to 1
    end try

    repeat documentCount times
        set theDocsPath to path of document of (first window whose id is theDocsID) --the name changes when an image is closed, but the main windows id stays the same.
        log theDocsPath
        tell application "Finder" to set theDoc to (theDocsPath as POSIX file) as alias
        tell application "Finder" to delete theDoc
        close (first window whose id is theDocsID)
    end repeat

end tell

Place this like before in an Automator service.

enter image description here


enter image description here

*


Some background on why this approach: Each image grouped or single image in a Preview.app's window are seen by preview as a window in and of them selves. And the Actual image as a document.

For example you have two images in grouped in one Preview window.

enter image description here

But what Preview.app sees is: Two windows with a document each.

And the frontmost window will always be a the select documents window.

What we see as the main window knows nothing about the windows inside of it.

This means you cannot use documents of window 1 etc. in the normal way. Because if you have a grouped window you will only ever get the selected image in the group.


*

| improve this answer | |
  • a + for all the work done and possible explanation of current behavior. – Ruskes Jan 24 '15 at 17:08
0

The other solution to this problem (personally I prefer the script app in the other answer I gave, but in case that doesn't suit for whatever reason) is to download Xee - an alternative to the preview.app that still allows you to move all items to the trash.

| improve this answer | |
  • 1
    It is a alternative and I will look at it, but does not solve the preview problem. I do know I am not the first nor the last lamenting but was hoping someone has found a way by now. – Ruskes Jan 20 '15 at 6:59
0

I know this is an old question, but I have found another solution that might be of interest.

  1. Create a "Trash folder" on your desktop that is symbolically linked to the actual Trash directory. (Follow the directions at http://osxdaily.com/2010/07/29/add-a-trash-icon-to-the-desktop/ to see how it's done.)
  2. Inside Preview.app, click on the filename in the title bar and click on the directory name popup in the "Where:" field. Scroll down to "Other..." and navigate to your Trash folder.

Some things that you might expect to streamline this, but strangely don't seem to work:

  • After doing this a few times, you will notice that the Trash folder does not show up in the list of "Recent Places" at the bottom of the directory popup.
  • You might also think you can streamline this by adding the Trash folder to the "Favorites" area of your Finder sidebar, and indeed you can -- but it still doesn't show up in the directory list when you are inside of Preview.app.
| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .