Delete file out folder

I have a drop folder that duplicates it content to another folder
How would I go about deleting or purging the contents in the drop folder once has transfered?
Thanks!

If there is a problem with your move statement, removing the try statement will show the error (you are suppressing error messages). I am testing with the following script, which appears to work for me:
<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
font-weight: normal;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px; height: 340px;
color: #000000;
background-color: #B5FF6C;
overflow: auto;"
title="this text can be pasted into the Script Editor">
property choiceTitles : {¬
"User 1", ¬
"User 2", ¬
"User 3"}
property chosenRecipients : {¬
{"User1 <[email protected]>", "User3 <User3@User3>"}, ¬
{"User2 <User2@sUser2>", "User3 <User3@sUser3>"}, ¬
"User3 <User3@User3>"}
property theSender : "MyEmail <[email protected]>"
property messageText : " type body copy here "
property commonName : "Files"
on run -- application double-clicked or run from the Script Editor
doStuff for (choose file with multiple selections allowed)
end run
on open theFiles -- items dropped onto the application
doStuff for theFiles
end open
on adding folder items to someFolder after receiving addedItems -- folder action
doStuff for addedItems
end adding folder items to
to doStuff for someFiles
create a new Mail message for each file in someFiles
parameters - someFiles [list]: a list of files to do stuff with
returns nothing
try
repeat with anItem in someFiles
set recipientAddress to (matchChoice from choiceTitles into chosenRecipients)
if the result is false then error number -128 -- cancel
tell application "Finder" to set theSubject to the name of anItem
tell application "Mail"
set newmessage to make new outgoing message with properties {content:(messageText & return & return)}
tell newmessage
set visible to true
set sender to theSender
set subject to theSubject
-- make new attachment with properties {file name:anItem} at after the last paragraph
repeat with someRecipient in recipientAddress -- handle multiple recipients
if class of someRecipient is list then -- handle recipient sub lists
repeat with aRecipient in someRecipient
make new to recipient at end of to recipients with properties {name:commonName, address:aRecipient}
end repeat
else
make new to recipient at end of to recipients with properties {name:commonName, address:someRecipient}
end if
end repeat
end tell
-- send newMessage
end tell
end repeat
tell application "Finder" to move someFiles to (path to desktop)
on error errorMessage number errorNumber -- oops
log errorMessage
-- display alert "Error " & errorNumber message errorMessage
end try
end doStuff
to matchChoice from sourceList into objectList
displays a dialog using the sourceList, then matches the item(s) chosen with the same item(s) in the objectList
if there are duplicate items in the sourceList, only the first matching item from the objectList is used
parameters - sourceList [list]: a list of text items to choose from
objectList [list]: a list of objects
returns [list]: a list of the chosen objects, or false if error/cancel
set chosenItems to {}
try
if (count sourceList) is greater than (count objectList) then error "matchChoice: sourceList is larger than objectList"
set theChoices to choose from list sourceList with multiple selections allowed
if the result is false then error "matchChoice : dialog cancelled" -- cancel
repeat with anItem in theChoices
set anItem to the contents of anItem
repeat with theIndex from 1 to (count of sourceList)
if the contents of (item theIndex of sourceList) is anItem then
set the end of chosenItems to item theIndex of objectList
exit repeat
end if
end repeat
end repeat
on error errorMessage
log errorMessage
-- error errorMessage -- pass it on
return false
end try
return chosenItems
end matchChoice
</pre>

Similar Messages

  • Deleting files out of system preferences desktop background.

    Does anyone know how to delete files out of system preferences>desktop & screen saver?
    Some how when adding one photo to the file for the desktop background it took the entire photo file. So that instead of one photo for the file it has over 200 now. Read everything and tried everything. Still can't figure out how to delete that file from the list.
    I know how to add photos or whatever to use as desktop background just no idea how to remove them from the list.
    Any ideas?

    Doug,
    When you go to system preferences>desktop & screen savers>desktop. On the left is a window with the names of the images listed. Apple Images, Nature file, Plants file, Picture Folder, Choose Folder and so forth. The ones that come with Apple products. Not sure what all else is native to Apple.
    Iv been using my own desktop background since the day I got the iBook. Normally I just get one photo or image and more it there to use. But, last week I did something different or wrong. Maybe holding a button to long, not sure. Instead of moving the one photo it moved the entire photo file. That file had over 200 (2,500x1,800 in size & over 550KB for each) and probably closer to 250 photos in it.
    Way to many to be there. And I simply can't find a way to remove that file from the desktop list. I can high light it, but it doesn't delete with the delete button. I can high light it, but it doesn't change anything in system preferences banner to edit, view, etc....to remove it either. It won't click & drag to trash.
    Being very careful because I don't want to delete the file and by error delete it totally off the computer. I could creat a new file with only 1 photo in it for use as the desktop background. Then try to choose that file. However, since the last big OS-X update it's been doing this. Everytime I choose a file or photo it's adding the entire file not just the 1 photo. And Iv managed to add 3 files so far to that list.
    Any ideas? Thx, Mike

  • Hi,delete file from folder?

    hi,i am deleting file from folder as follwos
    <%@ page import="java.io.File" %>
    <%
    File myFile = new File("D:\\jakarta-tomcat-4.1.18\\webapps\\ROOT\\upload_files\\xyz.txt");
    myFile.delete();
    %>
    i am sucessfuly deleted file from above path.
    if i use follwing code i unable to delete my file, can one help,
    how to do it,
    <%@ page import="java.io.File" %>
    <%
    String fname="xyz.txt";
    File myFile = new File("D:\\jakarta-tomcat-4.1.18\\webapps\\ROOT\\upload_files\\'"+fname+"'");
    myFile.delete();
    %>
    thanks
    pullareddy

    i think if above doesn't work try this it should work
    change this line
    File myFile = new File("D:\\jakarta-tomcat-4.1.18\\webapps\\ROOT\\upload_files\\'"+fname+"'");
    to this
    File myFile = new File("D:\\jakarta-tomcat-4.1.18\\webapps\\ROOT\\upload_files\\"+fname);

  • Delete file from folder only (not from list)

    Hi all,
    I've searched a lot and didn't succeed so far, that's why I need your help. In a cloud context, I'm actually creating and uploading files (pdf and/or xml files) "on the go" to sharepoint folders via the SOAP API and this is perfectly working. But
    in a cloud context, I also need to decomission services which is translated into deleting files into Sharepoint.
    That's where it became complicated, because according to the API we cannot delete files if they are not part of a list structure, which is not my case. Is that true ?
    The only info I have when trying to delete a file via the SOAP Api is : its name, its folder, and the endpoint where the folder is. So my question remains simple I guess : is this possible ? If so, how to (a link to the SOAP body would be usefull)
    Thanks a lot
    Regards
    Baptiste

    Hi,
    According to your post, my understanding is that you want to delete file from folder.
    In SharePoint 2010, It is recommended to use Client Object Model to achieve it, the following code snippet for your reference:
    string siteURL = "http://siteurl";
    ClientContext context = new ClientContext(siteURL);
    //specific user
    NetworkCredential credentials = new NetworkCredential("username", "password", "domain");
    context.Credentials = credentials;
    Web web = context.Web;
    context.Load(web);
    context.ExecuteQuery();
    string relativeUrl =web.ServerRelativeUrl +"/DocumentLibraryName/FolderName/FileName";
    File file = web.GetFileByServerRelativeUrl(relativeUrl);
    context.Load(file);
    file.DeleteObject();
    context.ExecuteQuery();
    If you still want to use SOAP API, we can use the UpdateListItems method under Lists web service to achieve it.
    http://www.dhirendrayadav.com/2010/06/delete-list-items-using-web-service.html
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/61466984-1844-48a1-8c1e-1c59a0f9876a/move-and-delete-files-remotely-using-sharepoint-web-services-?forum=sharepointdevelopmentlegacy
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

  • Delete File From Folder

    anybody know how we can delete the file from a folder??
    plz help!!!
    thanks in advance..

    File file = new File("d:\\file.txt"); //path to File
             if(file.exists()) {
             file.delete();
             }

  • Help needed on deleting files out of the library when syncs

    hi i uploaded a few video files of my wedding to my ipad by adding a file to library. As there are a few vidoes i uploaded i now want to delete them, how can i do this. I cant find anyway of taking them out of the library when the ipad syncs. I have unticked them in th elibrary but cannot find a delete button or option to get rid of them. I want to add disney fims into there now fromt he store.

    hi i uploaded a few video files of my wedding to my ipad by adding a file to library. As there are a few vidoes i uploaded i now want to delete them, how can i do this. I cant find anyway of taking them out of the library when the ipad syncs. I have unticked them in th elibrary but cannot find a delete button or option to get rid of them. I want to add disney fims into there now fromt he store.

  • Delete files from folder

    first of all please forgive me as I am new to the Java language... I have spent quite a lot of time with VB and now would like to learn Java. I've only completed a few very easy programs and read one book cover to cover. I really seem to do much better once I get my feet wet and complete a few programs...
    okay, here is what I'm trying to do:
    delete all files (not folders) in this directory:
    "c:\testing\"
    there are numerous folders within this directory. I don't want to delete the folders, just the .bmp files...
    I started with something like this, but I need some serious direction on how to go about this. I realize, my wildcard * is not valid. I think the basic delete command is correct, but I need help on how to use a wildcard as bellow (all folders within this directory and only files with the .bmp extension)...
    File f = new File("c:\testing\*\*.bmp");
    f.delete();
    Thanks very much for any help provided!

    You will need to use the Runtime Class where you can make a Op Sys call:
    exec
    public Process exec(String command)
    throws IOException
    Executes the specified string command in a separate process.
    The command argument is parsed into tokens and then executed as a command in a separate process. The token parsing is done by a StringTokenizer created by the call:
    new StringTokenizer(command)
    with no further modifications of the character categories. This method has exactly the same effect as exec(command, null).
    Parameters:
    command - a specified system command.
    Returns:
    a Process object for managing the subprocess.
    Throws:
    SecurityException - if a security manager exists and its checkExec method doesn't allow creation of a subprocess.
    IOException - if an I/O error occurs
    ex:
    String strFullCommand = "delete c:\*.foo";
    Runtime rt = Runtime.getRuntime();
         try
         child = rt.exec(strFullCommand);
         catch(IOException e)
         System.err.println( "IOException starting process!");

  • TS4153 few files and folder are not deleting from trash folder

    i am trying to delete all files and folders from the trash folder by clicking  empty securely, but its not deleteing the files anf folder. please suggest how to clean the trash folder by deleteing all the deleted files and folder.

    Securely deleting items in Trash writes Zeros over the data so that it is completely eradicated.
    This will take quit a long time depending on how much data you have in Trash.
    Unless there is data that needs to be rendered unrecoverable in the Trash, you could choose to just delete the files and folders with out the secure option.
    Once you have Emptied the Trash unsecurely you can always use disk utility to Securely Erase Free Space on the Drive.

  • How do you delete files in Terminal?

    I've searched the site looking for this because I've had a problem deleting files before and know there's a way to do it in Terminal, but can't seem to find the answer. I have an application and two txt files that won't delete, and won't allow me to drag them to the trash or change the file name.
    "The item cannot be moved to trash because it cannot be deleted."
    I'm on OS 10.2.8, I do have admin privileges and the files are not locked.
    If you can post the code to delete files in Terminal or if there is another option please let me know.
    Thanks

    Force-delete an item from desktop or Trash....this also will remove a locked
    file/application .... or ... a “file that is in use”
    1. Launch Terminal...type/copy/paste...
    rm <space> This deletes a file only
    sudo rm -rf <space> ..this deletes file or folder ,,,or ...
    sudo rm -R <space> this deletes file or folder
    2. Drag the offending item into the Terminal window. The path to it will appear.
    •To force-delete more than one item from the trash....click a item and press Shift or Command as you click additional items .
    3. Click on Terminal window, press .... Enter
    4. type your administrator password. Press ....Enter
    5. Click on the Desktop or the Trash window and the file will vanish.
    • If this does not work, then visit The XLab FAQs ....
    http://www.thexlab.com/faqs/faqs.html
    and read the FAQ on Trash problems for additional solutions.
    george

  • How do you delete [empty] a single file or folder from "Trash"?

    How do you delete [empty] a single file or folder from "Trash"?
    Can you "securely delete" just 1 item?

    A dangerous and incorrect shell command has been posted in this thread.
    NEVER empty the Trash in the shell (Terminal.) NEVER put anything in the Trash unless you intend to delete it immediately. If you do put something in the Trash and change your mind about deleting it, move it out or use the Put Back contextual menu item. Then empty the remaining items in the Trash as usual.

  • How do I delete the apple folder in common files

    I am trying to delete the apple folder from common files.  When I click on apple, internet services comes up.  I tried to delet those but it says they are open in the internet.  I don't know how to close them.  Please help.

    I just fixed this.  I had to,delete iCloud from my PC.  Make sure it is still on your ipad, etc.!!!  There were programs open in iCloud preventing me from deleting all the apple files so that I could reinstall itunes.  I did not find that out on any of the apple support postings.  Apple should have told me to delete iCloud as they did the other components. 

  • How do i know who deleted file/folder in Windows 7 ?

    Someone deleted files from Windows 7,i do not know it is remote or local.
    I want to know how was deleted ?
    And can i know what anybody doing (delete,add anything and etc.) on Windows 7 ?

    You need to enable auditing from either local policies or domain policies and apply it to the machine . you need to configure auditing on everything, you want to audit. Please following the given steps:
    1.Configure audit object access in AD Group Policy or on the server's local GPO.
    Computer Configuration --> Windows Settings --> Security Settings --> Local Policies --> Audit Policy --> Audit object Access
    Once that is in place, go to the folder you want to monitor, right click and go to properties
    2. Configure an audit entry on the specific folder's that you want to audit. Right-click on the folder-->Properties-->Advanced. From the Auditing tab, click Add and then enter the users/groups whom you want to audit and what actions you want to audit
    - auditing Full Control will create an audit entry every time anyone opens/changes/closes or deletes a file, or you can just audit for delete operations. You are now auditing that folder. You will need to monitor the event logs for the particular events.
    An alternate option available is here. You can try this utility (
    http://www.fileserverauditing.com) to find out who deleted specific files or folder. 

  • How do I remove or delete files within a document folder? I have tried dragging the files to the trash and it does not work

    How do I remove or delete files and image files within a document foler?  I have tried dragging the files to the trash, but that is not working. 

    Right-click (or ctrl-click) on a file. If the "move to Trash" option is greyed out, select "get info" and read the permissions at the bottom of the info window.
    Wat are they?
    Do the same for the enclosing folder - what permissions does that have?

  • Cover Flow view is out-of-sync after deleting files

    If you move a file to the trash while in Cover Flow, the file's contents are still displayed but the file is gone. Then as you use the arrow keys to move up and down, the file names continue to be out of sync with the content that's being displayed.
    The only way to sync them back up again is to change views or flip to another folder and flip back.
    If you continue to delete files based on the content you're looking at, you'll end up deleting the wrong files.

    I tried watching them in the timeline and viewer, all out of sync. No external monitor. I did get a message once about dropped frames and something else, it said I might have these issues, but it didn't tell me to change settings, just told me it was gonna happen, lol. So, I don't know where to start to fix it.

  • File not deleted from the folder

    Hi All,
    Im executing file to idoc scenario.
    my file processing mode is "delete" . But the file is not getting deleted from the folder but im getting success message in moni..
    other communication channels which are using the same ftp parameters are executing fine ( i.e files are getting deleted and success msg in moni ).
    the following is the error msg that i found in communication channel monitoring ...
    Failed to delete file 'IF416AQ1n.dat' after processing. The FTP server returned the following error message: 'com.sap.aii.adapter.file.ftp.FTPEx: 421 Timeout (120 seconds): closing control connection.'. For details, contact your FTP server vendor.
    please help me in this issue..
    deepu.

    Hi all,
    Thanks for your replies..
    Im using a file of size 230744 bytes of type dat.
    time out: 600
    poll interval: 300
    retry interval : 120
    i communication chanell monitering i can see the following message ..
    Failed to delete file 'IF416AQ1.dat' after processing. The FTP server returned the following error message: 'com.sap.aii.adapter.file.ftp.FTPEx: 421 Timeout (120 seconds): closing control connection.'. For details, contact your FTP server vendor
    file is not getting deleted.. what are the changes that i need to make ???

Maybe you are looking for

  • Wireles Airport not working since upgrading to Leopard

    I run a laptop via a NETGEAR wireless system from my main machine. I had no problem until I upgraded to Leopard. Now the laptop doesn't see the wireless via airport. help!!

  • File Sender - Internal driver error

    Hi, I am having a file to RFC scenario. The file can have size  varying from 5 to 15 MB. We are getting an error in the sender channel, while picking the file. Error text: Could not insert message into database. Reason: java.sql.SQLException Internal

  • Working w / gmail and 'all mail'

    If I understand correctly, apple mail is working better with gmail now. In the past, I turned off SHOW in IMAP for 'all mail' then apple mail saw just one copy of each mail in their folder/lables. NOW we are forced to use all mail - but I am told it

  • Mac Mini - Toshiba DLP?

    Hi, I would like to get rid of Time Warner Cable for good so I am thinking of getting either a Mac Mini or possibly a Macbook to hook up to my Toshiba DLP projection TV. So, my first question is - will this TV be acceptable to use? My second question

  • Multiple SOA clusters within a Single Domain

    Hi All, We're looking at a scenario where there would be multiple SOA clusters within a single domain. Would that be possible to do? I mean I can create multiple SOA clusters but it seems that applications deployed to one of the 2 SOA clusters seem t