Applescript move .jpgs then empty trash

i've got the following as an app/droplet
and it keeps coming up with error "can't get class <<class nmxt>> of application finder" and i can't work out why
on idle
          tell application "Finder"
                    get name of folders of folder "Lacie Drive:Server_1:Production:  ALL - Production: PAB Design Orders:Out:"
                    if name extension contains ".jpg" then
  move trash
                              tell application "Finder"
                                        empty trash
                                        return 200 -- do it again in 200 secs
  --with timeout of 1000 seconds -- ignoring application responses
  --end timeout -- end ignoring
                              end tell
                    end if
          end tell
end idle
I thought it might be something like:
on idle
                    get name of files of folder "Lacie Drive:Server_1:Production:  ALL - Production: PAB Design Orders:Out:"
                    if name extension contains ".jpg" then
  move trash
                              tell application "Finder"
                                        empty trash
                                        return 200 -- do it again in 200 secs
  --with timeout of 1000 seconds -- ignoring application responses
  --end timeout -- end ignoring
                                        end get
                    end if
          end tell
          end get
end idle
but keeps telling me i'm wrong, anyone that can help would save me a lot of time?

The choose folder command only returns the choice the user selectet. It is up to you to take that value (in the variable folderChoice in this example)  and tell Finder to serach in that folder.
on idle
          set folderChoice to choose folder default location (path to home folder)
          tell application "Finder"
                         set fileList to files of folder folderChoice whose name extension is "jpg"
       move fileList to trash
                         the trash
                         return 200 -- do it again in 200 secs
       --with timeout of 1000 seconds -- ignoring application responses
       --end timeout -- end ignoring
          end tell
end idle

Similar Messages

  • HT201260 Tried to remove Symantec End Point software by dropping it in the trash and then emptied trash, of course now when I try and install newer version it tells me to uninstall the older version I can not access now. Any solutions?

    Tried to remove Symantec End Point software by dropping it in the trash and then emptied trash, of course now when I try and install newer version it tells me to uninstall the older version I can not access now. Any solutions?

    You usually have to use the program's uninstaller utility for such things as Symantec. Read this:
    http://www.symantec.com/business/support/index?page=content&id=TECH132120
    You may need to install it all over again, just to use its uninstaller.

  • Lightroom 5.5 grid view fails to load some images.  These do load in develop, then re-appear in grid.  Re-installed 5.4 (after deleting 5.5, then emptying trash in 10.9.5) and it now exhibits same behavior.  Suggestions?

    These same images fail to load in slideshows; "loading" appears without the image ever appearing.  I can export these grayed-out images and retrieve the image content in the exported file.  Not being able to see all images in grid view is an inconvenience for sure; e.g., I can't review all the contents of a collection before posting it.  This behavior didn't occur until I upgraded to 5.5.  Now it has migrated back into 5.4, despite having selected 5.5 and emptying trash before the re-install.

    Whoa this is happening to me...

  • Cannot Delete files or Empty Trash

    I exported an image sequence in Quicktime to a folder. The number of images exported was in excess of 30,000 jpeg files. I have tried to throw out the folder but the finder will NOT delete it. and I have tried to use the terminal to rewrite the trash with a new trash directory and it too cannot overwrite the files/Trash folder while the images are inside. i get terminal error messages or the finder ends up in an endless loop trying to empty the trash... "Items to delete: 30,698" nothing happens beyond that message. anyone know how to delete these files?

    There is a way of forcing the Finder to empty the trash no matter what! It is done in the freeware customization and maintenance application OnyX (download @ http://www.titanium.free.fr/pgs/english/apps.html ). Once you loaded OnyX and entered your administrator password, choose "Cleaning" in the top bar. Click on the "Trash" tab. You can now choose whether you want to "Delete" or to "Securely Delete" (by overwriting) and click Execute. That's it, it will force the Finder to empty the trash even if the files are in use!
    Many times, depressing the Option key while emptying Trash will empty problem files. Another method – start by depressing the mouse over the Trash icon. Then empty trash from the pop-up menu. The files should be emptied.
    Also look at these links.
    You can't empty the Trash or move a file to the Trash in Mac OS X
    http://docs.info.apple.com/article.html?artnum=106272
    Solving Trash Problems
    http://www.thexlab.com/faqs/trash.html
    How To Fix Stubborn Trash and Why it Won't Delete
    http://www.osxfaq.com/Tutorials/LearningCenter/HowTo/Trash/index.ws
    Download Trash It! v3.6.1 from:
    http://www.nonamescriptware.com/?page_id=5
    Download DropNuke from:
    http://www.versiontracker.com/dyn/moreinfo/macosx/12664
     Cheers, Tom

  • Possible solution for Empty Trash crashing

    iPhoto continues to crash on me when emptying trash. I would think Apple could have fixed this by now, but I found something that works MOST of the time. After sending pics to trash, I open trash, move the scaling slider to smallest possible image, and then empty trash. Doesn't always work on the first try, but results are better than constantly restarting and emptying trash from normal views.

    Replying to my own post? OK, I fixed my connectivity problem and did not need to uninstall iTunes. Originally I'd installed via System Update and had the aforementioned problem. So...I then downloaded iTunes directly from Apple and ran the installer...over top of my existing 8.2.1. When I did this I noticed that "custom" install includes two components. There's iTunes and there is mobile device somethingorother. By default they were both checked but I don't remember if that was the case with the install via System Update. It may have been but I hadn't chosen "custom." So...voila...now my iTouch connects and I didn't even have to restart the computer, let alone uninstall iTunes. Your mileage may vary but I'd suggest this reinstall as an easy first step if your Mac won't recognize your iTouch after installing iTunes from System Update.

  • Can't Empty Trash - Please help

    I tried emptying the trash after throwing a ton of stuff out, and there were a bunch of locked files in there (mostly application support files).
    I unlocked every single one and tried emptying the trash again and it says they're still locked. I did a find file for the specific names of the files that it says are locked, and all versions of that particular file show up as unlocked.
    What am I doing wrong? Thank you for your time.

    Many times, depressing the Option key while emptying Trash will empty problem files. Another method – start by depressing the mouse over the Trash icon. Then empty trash from the pop-up menu. The files should be emptied.
    Look at these links.
    You can't empty the Trash or move a file to the Trash in Mac OS X
    http://docs.info.apple.com/article.html?artnum=106272
    Solving Trash Problems
    http://www.thexlab.com/faqs/trash.html
    How To Fix Stubborn Trash and Why it Won't Delete
    http://www.osxfaq.com/Tutorials/LearningCenter/HowTo/Trash/index.ws
    Download Trash It! v3.6.1 from:
    http://www.nonamescriptware.com/?page_id=5
    Download DropNuke from:
    http://www.versiontracker.com/dyn/moreinfo/macosx/12664
     Cheers, Tom

  • Cannot empty trash on my eMac no matter what I do.

    It has 2 folders in it - an iMovie cache and media folder in it.  I tried holding down the option key when emptying.  I always "secure empty" all trash files.  Please help because the trash is taking up a lot of HD space.  The progress bar window pops up but sometimes there is no "blue" progress indicator and sometimes there is no blue indicator at all.  I have allowed it to run for over an hour.  There is approximately 787 MB in the media folder and only 112 kb in the cache folder.

    If you have the problem where you can’t empty the Trash or eject a disk because something is preventing you? Usually the reason is because some application has a file open, and thus you can’t get rid of the disk or trash the file. Then use What’s Keeping Me! What’s Keeping Me will identify the application that is preventing you from accomplishing your task. You can then use What's Keeping Me to quit, relaunch, or kill the problem application so you can get on with your business.
    http://www.hamsoftengineering.com/products/wkm/wkm.html
    Sometimes it happens that the Finder just doesn't want to empty the trash anymore and says "The operation cannot be completed because the item "" is in use.". That's a good warning if it is true, but sometimes you want to get rid of an application and this warning appears even though the only thing running is the Finder. Usually after a restart you can delete it. But that is very time consuming and even then, it is sometimes still stuck not wanting to be deleted. There is a risky command that can be used in the Terminal that will empty the trash no matter what. Risky because a simple error in the syntax could erase a lot of stuff that you want to keep.
    There is a way of forcing the Finder to empty the trash no matter what! It is done in the freeware customization and maintenance application OnyX (download @ http://www.titanium.free.fr/pgs/english/apps.html ). Once you loaded OnyX and entered your administrator password, choose "Cleaning" in the top bar. Click on the "Trash" tab. You can now choose whether you want to "Delete" or to "Securely Delete" (by overwriting) and click Execute. That's it, it will force the Finder to empty the trash even if the files are in use!
    Many times, depressing the Option key while emptying Trash will empty problem files. Another method – start by depressing the mouse over the Trash icon. Then empty trash from the pop-up menu. The files should be emptied.
    Also look at these links.
    You can't empty the Trash or move a file to the Trash in Mac OS X
    http://docs.info.apple.com/article.html?artnum=106272
    Solving Trash Problems
    http://www.thexlab.com/faqs/trash.html
    How To Fix Stubborn Trash and Why it Won't Delete
    http://www.osxfaq.com/Tutorials/LearningCenter/HowTo/Trash/index.ws
    Download Trash It! v3.6.1 from:
    http://www.nonamescriptware.com/?page_id=5
    Download DropNuke from:
    http://www.versiontracker.com/dyn/moreinfo/macosx/12664
     Cheers, Tom

  • Emptying trash cant be completed error code 8003

    file:///Users/fljwb/.Trash/VLCStreamer%20(1.62).app/file:///Users/fljwb/.Trash/u ntitled%20folder/VLCStreamer.app/ completely uninstalled VLC & VLC streamer with App cleaner - tried using prompts in terminal restarted computer ran permissions repair trash will not empty these items receive error code 8003 short of downloading and reinstalling VLC streamer I have covered all that I can think of.

    Ok sussed out a solution I moved named files to Hard disk number 4 then empty trash then found the folders on HD 4 trashed them them empty trash end of problem all gone(never had that one!)

  • How do I get past error - 8003 so I can empty trash?

    When I try to empty trash I get the error message -8003
    What needs to be done so I can empty the trash?

    Launch Terminal.app(/Applications/Utility/Terminal), then type
    cd ~/.Trash
    chflags -R nouchg *
    Then empty trash in Finder as usual.

  • Empty Trash Crashes Computer

    Help! Every time I try to empty trash that screen appears telling me to hold down the power key for several seconds to restart the computer.
    PB17 1.67ghz w/@gbRAM 2 500gb external HD's attached via FW800
    The items in the trash are off of the external drives. Please help, my trash can overfloweth!
    Patrick

    Have you tried unmounting and disconnecting the drives, then emptying trash?
    For further troubleshooting tips on kernel panics see Dr. Smoke's FAQ.
    -mj
    [email protected]

  • I cannot delete a file from the document folder.  I can move it to the trash and then empty the trash, but when I go back to the documents folder it is still there.

    I cannot delete a file from the documents folder.  I can move it to the trash and then empty it, but when I go back to the documents folder, the file is still there.

    Gay,
    I wonder what your computing environment is. Is your account being administrated by another account? Are you working in an account subject to "Parental Controls"?
    Jerry

  • Aperture ate my picture files and they are not recoverable.  The guy at the Genius Bar told me to Trash the App, empty Trash, then go to Purchases and reinstall.  But Purchases says it is "Installed" so it does not let me download it again.  HELP!!!!

    Aperture ate my picture files and they are not recoverable.  The guy at the Genius Bar told me to Trash the App, empty Trash, then go to Purchases and reinstall.  But Purchases says it is "Installed" so it does not let me download it again.  HELP!!!!

    I typed Aperture into Spotlight and sure enough it did show up.
    It looks like it is supposed to be in Apps.
    But it is not there.
    So I clicked on the spotlight Aperture and it opened up the App!!!!
    But I do not know where it is to move it!
    How can I find it?
    While Aperture is running and you are seeing it in the Dock, ctrl-click (or right click) the Dock icon.
    You will see a contextual menu. Click on "Options", then select "Show in Finder".
    And check the "keep in Dock" mark, so you will not lose it from the Dock.

  • Having an AppleScript Move All Files of a Certain Type From Sub-Folders to Trash

    Greetings, everyone. With my introductory post, I would like to ask for help with an AppleScript I've been slaving over for the past five hours or so. I have tried Terminal and Finder commands both, along with lots and lots of Googling, and I cannot seem to get this to work.
    Specfically, I want a script to look into a folder and all of its sub-directories, locate all files with a certain extension (in this case, APP), and then send every one of those files to the trash. Originally, I planned to delete them directly with Terminal commands that required verification, but I couldn't get that to work, and I thought that this would be a more average user-friendly version, anyway.
    I also wondered if there was any universal means of referring to a system drive without referring to it by its name, since (as you'll see in the script) the directory that these *.app files will be moved from is in the Users/Shared hierarchy. However, it's meant to be used on multiple computers, so naming the OS drive on one won't work for others. If no such wild card exists, is what I'm doing now (having the script placed in the root folder of the OS drive) acceptable?
    As it is, when I run this script, it displays all the dialogs, but the APP files aren't moved. It doesn't error at all in the AppleScript editor, it just runs and then closes down. I don't know what I'm doing wrong.
    Thank you in advance for any help you can provide.
    =====
    if button returned of (display dialog "Trash all of the APP files in your SuchAndSuch folder? (This script must be in the root directory of your system drive.)" buttons {"Yes, I'm ready", "No"} default button 2 cancel button 2 with title "SuchAndSuch Folder Prep" with icon caution) is "Yes, I'm ready" then
        set theFolder to ":Users:Shared:SuchAndSuch:" as alias
        tell application "Finder"
            set theFiles to every file of theFolder whose name extension is "app"
            move theFiles to trash
        end tell
    end if
    if button returned of (display dialog "The APP files have been trashed." buttons {"OK"} default button 1 with title "SuchAndSuch Folder Prep" with icon 1) is "OK" then
    end if

    Well, you've done more fiddling than that; you've moved everything inside the Finder tell block.  Why did you do that?  If you recall my point 2 above, it is difficult to use POSIX paths or the POSIX file command inside Finder tell blocks without generating errors, but you've done both in your revision.  I'm surprised that you're surprised that it doesn't work. 
    Applescript tries to be user-friendly, but it's still a programming language, and like any programming language the devil is in the details.  Changes that seem small and innocuous to you can make big differences in the result you get.
    Now:
    /Users/Shared should be machine independent in POSIX: you don't need to specify the hard drive name and it should be universal on all OS X installations.  You can specify it directly.
    The Finder's delete command moves fils to the trash, it doesn't erase them.  Trying to use the move command to get files to the trash is a little bass-ackwards.
    Don't put anything inside a Finder tell block unless it has to be processed by the Finder.  If you do you're just begging for errors.
    There's no need to put the script at the root level of the drive.  If the Finder needs permission to delete a file it will ask.
    untangled and revised:
    set subfolderOfSharedFolder to quoted form of "/Users/Shared/<subfolder name>"
    set response to display dialog "Trash all of the APP files in your <subfolder name> folder?" buttons {"Yes, I'm ready", "No"} default button 2 cancel button 2 with title "<subfolder name> Folder Prep" with icon caution
    if button returned of response is "Yes, I'm ready" then
      -- run spotlight search
              set filesToDelete to paragraphs of (do shell script "mdfind 'kMDItemFSName == *.app c' -onlyin " & subfolderOfSharedFolder)
      -- convert posix paths to file specifiers
              repeat with thisFile in filesToDelete
                        set (contents of thisFile) to POSIX file thisFile
              end repeat
              tell application "Finder"
      delete filesToDelete
              end tell
              if button returned of (display dialog "The APP files have been trashed." buttons {"OK"} default button 1 with title "SuchAndSuch Folder Prep" with icon 1) is "OK" then
              end if
    end if

  • I am deleting files through my trash in my macbook pro (2010) and then emptying the trash can, but my hard disk space is not increasing! i recently upgraded to lion and the problem is new, wasn't the same with snow leopard! HELP!!!!!

    i am deleting files through my trash in my macbook pro (2010) and then emptying the trash can, but my hard disk space is not increasing! i recently upgraded to lion and the problem is new, wasn't the same with snow leopard! HELP!!!!!
    When i press command+I (Get Info) i see that there is 140 GB "Available Space" on my hard disk but when i click on my hard disk icon on the desktop, and then press "space" i only see 102 GB free!! What the f*???
    Please HELP!!!!!! Getting second thoughts on Lion!!!!

    Hi b,
    Have you restarted yet?

  • When I try to finalize my Imovie11 project it just errors out.  I have finalized other movies without incident and it will save the trailer. I've emptied trash and run all updates and there isn't a specific error code popping up.

    When I try to finalize my Imovie 11 project it errors out.  I have made several movies and never had this problem.  I have emptied trash, and installed all updates to computer.  It will finalize the shorter, trailer but not the project itself.  It is not, by far, the largest project I've ever done. I am not getting a specific error code. 

    When I try to finalize my Imovie 11 project it errors out.  I have made several movies and never had this problem.  I have emptied trash, and installed all updates to computer.  It will finalize the shorter, trailer but not the project itself.  It is not, by far, the largest project I've ever done. I am not getting a specific error code. 

Maybe you are looking for

  • How can I convert a ra/rm file to an mp3?

    I have a Real Audio file (that downloaded as an mp3 but doesn't play on my iTunes (because it's streaming). Is there a free software that can convert ra/rm files to mp3? Thanks!

  • User Settings in Multi-user setup?

    We are using two new CS5 editors in our news department.  We set the machines up on our Domain partly for being able to use NTFS permissions and because our IT department hates stand alone machines. The issue we are having is that each person logs in

  • ABAP WebDynpro - ArchiveLink - PDF Error: "File does not start with..."

    Hey community, I have a WebDynpro application in which I want to show a Archive document. I'm using FM 'ARCHIV_GET_TABLE' and then FM 'SCMS_BINARY_TO_XSTRING'. But I only get the error message: (see also attached) File does not open with "%PDF-". Loc

  • PDF file in iview

    Hi All, we have to create an iView using NWDS to displays a PDF document generated through a SAPScript or Smartform. Please let us know how to achieve this. Thanks in advance. SAP EP Team

  • HT1491 In apps purchasing.

    Guys, when i am trying to buy somthing from ( in app. Purchasing) it give me a message says contact apple support for assistance. All my information are correct.