Applescript to move files in a folder to the parent folder.

I've got tens of thousands of files in folders that I'd like to be automatically moved out of the folder thier in to the parent folder.
For example:
Summer Vacation/img/photo.jpg
I need all of the files in the folder img to be moved out of img and into Summer Vacation.
Monthy Report/final/report.ppt
I need all of the files in the folder final to be moved out of final and into Monthly Report.
So the specifics are many and varying. A script that would work without specific file and fodler names might work better.
Any thought on this would be greatly appreciated.

You can use launchd to run a script daily.
The script would move files that are older than 7 days (based on the access time) from the Downloads Folder to the Desktop (edit as needed):
#!/bin/bash
seven_days_ago=$(date -v -168H +%s)
for f in ~/Downloads/*
do
          if [ -e "$f" ] ; then
                    if [ $(stat -f %Da "$f") -lt $seven_days_ago ]; then
                              mv "$f" ~/Desktop
                    fi
          fi
done
Put this script in your favorite Folder (I use ~/Library/Scripts)
Now to trigger the script daily, place this launchd plist in ~/Library/LaunchAgents/, and edit for the location of the script, and when you want it to run (I have it at 8:24pm daily).  Reboot (or log out and back in) for the launchd to take effect.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
          <key>KeepAlive</key>
          <false/>
          <key>Label</key>
          <string>com.tonyt.MoveFiles</string>
          <key>ProgramArguments</key>
          <array>
                    <string>/Users/Tony/Library/Scripts/MoveFiles.sh</string>
          </array>
          <key>StartCalendarInterval</key>
          <dict>
                    <key>Hour</key>
                    <integer>20</integer>
                    <key>Minute</key>
                    <integer>24</integer>
          </dict>
</dict>
</plist>

Similar Messages

  • How do I move files from one folder to another?

    On my MacBookPro I am trying to move files from one folder to a BSB drive.  I can copy, but I do not want the files left in the original location.  What do I do?
    J W

    Press the Command key while dragging them.
    (58054)

  • Is there a way to move files from one folder to another without copying and pasting and then going back to delete the original?

    Is there a way to move files from one folder to another without copying and pasting and then going back to delete the original?  The cut and paste function is not available and there's no "move to" function.  Am I missing something?  It was so easy with Windows.

    Drag the files, or press Option when pasting them; this accesses the Move To function.
    (124070)

  • Can you manually move files within a folder to put them in a specific order?

    I am new to mac, I was wondering if there is an app maybe that you could move files within a folder (ie photos) to make them in a specific order and then rename them, I used to be able to do this with my windows xp..... cant seem to make it happen with my new macbook pro and from what i can gather it cant be done? can it? Thanx in advance.........

    Thomas, I have set the view to maunally but when i move the icons they return to where they were sitting..?
    In the Finder? You probably have a sort selected in the Sort By submenu in the View menu. However, the order of icons in icon view won't have any influence on the order of the images in the slideshow, I think. Use iPhoto, this is one of the things it's made for, the Finder is not.

  • How to move files from one folder to another folder in webdynpro java for sap portal

    Dear Experts,
    I wan to move files from one folder to another folder in SAP portal 7.3 programmatically in webdynpro java.
    My requirement is in my portal 1000 transport packages is their. Now i want to move 1 to 200 TP's into Archive folder.
    Can you please help me how to do in through portal or wd java ...
    Regards
    Chakri

    Hello,
    Do you know what the difference between copying a file this way :
    ** Fast & simple file copy. */
    public static void copy(File source, File dest) throws IOException {
    FileChannel in = null, out = null;
    try {         
    in = new FileInputStream(source).getChannel();
    out = new FileOutputStream(dest).getChannel();
    long size = in.size();
    MappedByteBuffer buf = in.map(FileChannel.MapMode.READ_ONLY, 0, size);
    out.write(buf);
    } finally {
    if (in != null) in.close();
    if (out != null) out.close();
    ================SECOND WAY============
    AND THIS WAY:
    // Move file (src) to File/directory dest.
    public static synchronized void move(File src, File dest) throws FileNotFoundException, IOException {
    copy(src, dest);
    src.delete();
    // Copy file (src) to File/directory dest.
    public static synchronized void copy(File src, File dest) throws IOException {
    InputStream in = new FileInputStream(src);
    OutputStream out = new FileOutputStream(dest);
    // Transfer bytes from in to out
    byte[] buf = new byte[1024];
    int len;
    while ((len = in.read(buf)) > 0) {
    out.write(buf, 0, len);
    in.close();
    out.close();
    And which is better? I read up on what each kind of does but still a bit unclear as to when it is good to use which.
    Thanks in advance,
    JavaGirl

  • Move files from one folder to another javascript?

    I am running a 3-action droplet automatically using windows task scheduler.  Here are the 3 steps:
    1.    Batch file to move files from hot folder to processing folder
    2.    Run IPP (dr brown's image processor pro) using preloaded settings to make several sizes copies of the files.
    3.    Bat file to move the files from processing folder to archive folder.
    The problem I am observing is that Step 1 works and IPP begins to run.  It only processes the first few images, and then moves on to the 3rd step where the bat file is ran to move all files from processing folder to archive folder.   The trouble is, only a few images were processes (about 10 or so), yet all of the images get moved to the archive without being processed.  Is there a way to make sure that step 2 (IPP) doesn’t begin until all files have successfully been moved from the hot folder to the processing folder?  IPP starts right away and files are still being transferred to the processing folder.
    Does anyone have a script that will move files from one folder to another? 

    I'm sure I have see a way to close down Photoshop in a Photoshop script.  I never had the need to.  It may be a simple statement like app.close(); I don't know javascript and only hack Photoshop script mostly by looking at others code.  app.close(); is a guess on my part. Let me try it. I was wrong its photoshop.quit();
    So make your MoveToArchive.jsx look something like this
    try{
       var BAT = new File(Folder.temp + "/MoveFilesToArchive.bat");
       BAT.open("w");
       BAT.writeln('Copy /Y "c:\\Process\\*.jpg" "c:\\Archive\\*.*"');
       BAT.writeln('Del "c:\Process\\*.jpg"');
       BAT.close();
       BAT.execute();   // execute the temp bat file
    }catch(e){
    alert("Bat MoveFilesToArchive  failed to execute.");
    photoshop.quit();

  • Mac won't let me move files into a folder bc it THINKS there are duplicate files - but they're not

    Mac won't let me move files into a folder bc it THINKS there are duplicate files - but they're not. There are hundreds of what it thinks are duplicates. How can I get it to let me put them all into a folder and create unique names? If I do one file at a time, it gives me the option to keep both files. But not when I am moving hundreds at a time.

    A reply to an old problem, but I couldn't find this solution anywhere. I had the same problem when I moved my iTunes library to an external drive. As Apple recommends, I used File > Library > Organize Library > Consolidate Files to copy my music files from my overstuffed hard drive to the external drive. Copying went fine for a while, adding about two-thirds of my files to the new drive without incident. Then I got the big stop sign with the error message: "Copying files failed. The disk could not be read from or written to."
    This turned out to have nothing to do with either the hard drive or the external disk. I had a bad file in my music library that was shutting down the consolidation process. Unfortunately the error message says nothing about which file may be the culprit. All I could think to do was to go back to my original library in iTunes and sort by Artist, select all cuts with artists beginning with A, right click and select "Consolidate Files". Then do the same with B artists, etc. Proceeding this way, files resumed copying but when I got to the "S" selections, the consolidate process failed again. Then I selected smaller and smaller batches until the problem file was identified. Removed it from my library and then Consolidate worked fine through the rest of the library. Problem solved.
    I spent several days working through this; hope I can save someone else the time.

  • Why can't i move files from one folder to another by sliding them?

    help. i am trying to move files from one folder to another. but i cant slide them by clicking on a file and sliding it to another place. any suggestions? thank

    Go to Finder "Go" menu hold the option key and choose Library. Then go to Preferences trash these files:
    com.apple.finder.plist
    com.apple.sidebarlists.plist
    Then, restart, or log out and in again.
    (You will have to reset a few finder prefs the way you like them.)

  • I have an older Sony digital camcorder, and I am having trouble importing the movie files. Sometimes I get the audio in iTunes without the picture. I have a Pinnacle Dazzle interface. What am I doing wrong. Is there a way to skip the dazzle device?

    I have an older Sony digital camcorder, and I am having trouble importing the movie files. Sometimes I get the audio in iTunes without the picture. I have a Pinnacle Dazzle interface. What am I doing wrong. Is there a way to skip the dazzle device?

    Chances are the pinnacle is producing .avi files or MPEFG1/2 streams - iTunes may know how to decode the audio but not the video. Download Handbrake and try running the Pinnacle files through it and adding to iTunes - use Universal format unless you have a specific device in mind.
    Keep copies of the originals.
    Another option might be to try to install Perian.  Can't remember if the Apple MPEG2 plugin allows MPEG2 to be played in iTunes.
    AC

  • Premire only import audio in a .mov file, how can i get the video?

    premire only import audio in a .mov file, how can i get the video?

    Wild Guess:
    If that is not the solution:
    FAQ: What information should I provide when ask... | Adobe Community 

  • FTP-File : move file from a folder to another

    Hi experts,
    Here is the deal :
    I have a FTP folder (OS windows) where my files are stored. As I want XI to pick them one by one, I need a way to move them one by one in another folder of the FTP before message processing, folder that will be polled by XI
    How can I do that ?
    more concretly :
    I have 5 files in a folder called Standard, files are named : TEST1_hhmmss.xml, TEST2_hhmmss.xml, etc.
    I have another folder, lets say Standard_child that XI scans every 5 minutes. As I want my 5 files to get picked one by one every 5 minutes, I need a way on the FTP before message processing that moves TEST1_hhmmss.xml in folder Standard_child then XI picks up this file, and so on until all files are consumed.
    Thanks a lots for any help, ive been struggling for days... so far I tried with a script that renames file before, but did not work on FTP...
    Kind regards,
    Jamal

    Hi
    This site may be helpful
    http://www.computing.net/answers/programming/batch-to-move-file-by-sysdate/14939.html
    you can check the net for more answers
    1) make a logic & ensure that ur script works fine in your sender system (where all files will be placed)
    2) you can try it urself if you have access to the systems command prompt
    3) use scheduler, of your sender system (you said it is windows) you can check help to see how you can schedule programs - there call your script.
    4) now your script will send the files to child folder one by one as per your logic, which can be picked by XI
    Regards
    Vishnu

  • Move files from one folder to another

    I am brand new to the application and have spent a ton of time googling various topics, but need some additional help. Seems easy enough, but I can't figure out how to do it...
    I would like to move pics from one folder to another. I can drag files from one folder to another, but they still reside in the original folder as well. Is there a way to cut and paste or a similar function to accomplish this move?
    Thanks.

    Hey, HawaiianHaole, as a multidecade Mac user, let me tell you, Aperture is about the worst example of Mac-iness one could imagine. Ironic, as it's (of course) made by Apple. But it is so inflexible, and insists so vociferously on making the user learn its peculiar interface conventions it reminds me most of something out of that famous company in Redmond.
    Want your Projects in an order you choose? Sorry! Want to arrange your windows so you can see your list of chat buddies while you're working in Aperture? Nope, can't do it! Aging eyes have trouble reading tiny grey type on a grey background? Hey buddy, it was your choice to grow old, don't blame us!
    But all is not lost. Aperture has gotten considerably better of late (versions up to 2.0 were fundamentally unusable in many ways) and will hopefully continue to improve. (ie Maybe they'll fix the printing thing...)
    Please don't make Aperture the basis for your judgement of the Mac OS. Many long time Mac users are having as much trouble with Aperture as you. Mac OSX has significantly reduced customizability but at the benefit of much improved stability and indeed usability. Old school Mac users had to learn to accept this, which most did. You'll hear people talk about the "Way of the Steve". As irksome as Aperture can be, you'll actually have a better time of it if you adopt the Way of the Steve, and accept that you can't do things the way you might want to. This is imho antithetical to the original Mac many of us knew and loved, but it's the way things are today, so we mostly shut up and take it. You can fight with your software all day, or just accept that there are ways you have to adopt and adapt to them.
    Welcome to the Bright Side, hope your Mac experience improves.

  • I suddenly can't move files from one folder to another in my FlashHelp project.

    I have RH8 (8.02). I have been working on this project for a couple of years now.
    What changed? I had imported a Word document and then removed the document and the folder it created from the Project Manager. Now I cannot move any of my files from one folder to another in the Project Manager pod. I susptected a corrupt CPD file so I closed the project, deleted the CPD file. Next I opened Robo from Programes (I never open from the .xpj file), went to Tools>Options and deleted the pinned most recently used project. Select Open, and locate/open the xpj file. I've also re-generated the output (no errors) and completed all these steps again. Of course Robo only goes haywire on me right before I have to publish for our new software release.

    Hi there
    From what I'm seeing my own guess here is that RoboHelp is still believing that the content belongs to word.
    I might suggest the following steps.
    Open Winows Explorer and make copies of the HTML files involved. Then from RoboHelp, delete or remove the content. Then use the Import function to add the desired HTML files back into the project into the desired folder.
    My thought is that by taking these steps you will have effectively disassociated Word and the topics should now be independent topics that RoboHelp should allow you to manage as you wish.
    Hope you get it sorted... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7 or 8 within the day - $24.95!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • Need to automatically move files to another folder

    I have been playing around and can't find the answer I need, please help...
    I shoot photos in RAW+JPEG and, therefore, have two files for each image in folders on my memory cards. I now have AutoImporter set to automatically import all files form the card to a subfolder within Pictures called Auto Import. I would like to add a folder action or script of some sort on Auto Import that would take the JPEGs and move them to a different folder automatically after import (addition to this folder.
    My goal here is to split the RAW from JPEG into separate folders so that I can have Time Machine and iDisk back up just the JPEGs, leaving the RAW only for editing in Aperture.
    I am pretty new to Mac and not very familiar with scripts or folder actions but I can muddle through. I looked around Automator but could not see any action that might work.
    Thanks for any help.

    OK, forget everything else, here's where I am at...
    Got Aperture importing and saving the files into folders just the way I want. It is creating backup copies to a second folder.
    I am using Aperture to import images to specific folders as follows:
    1) Imports RAW+JPEG files to folder "Import"
    2) Also sends copy to backup location folder "Jpeg Files"
    3) Each set of files goes into a subfolder within "Import" and "Jpeg Files" that is labeled with the shot date (so the paths would be ...pictures/"Import"/"shot date" and ...pictures/"Jpeg Files"/"shot date")
    Now, the goal is to set a folder action to "Jpeg Files" that would look for the RAW files and delete them, thereby leaving just the JPEG file in the folder labeled with the shot date. Of course, folder "Import" would still have both the RAW and JPEG versions.
    I worked with Automator to create a folder action for "Jpeg Files" that would include Find Finder Items and selecting Search "Jpeg Files", then Any-File Extension-Is-"NEF" (NEF is the RAW file extension). I then add Move Finder Items To Trash.
    When I run from within Automator, it works perfectly and deletes just the .NEF file. As soon as I apply the action to the folder, however, and run through the steps, it deletes the subfolders containing the NEF file and the JPG file instead of just the NEF file.
    What am I doing wrong?? I just want it to delete the file type, not the folders.
    Thanks for your help!

  • Samba 4: users unable to move files from compressed folder to Samba share

    I have recently upgraded Samba 3.6.x from Centos 6.6 to Samba 4.1.12 on Centos 7.The shares were migrated in place. I reset permissions and Windows ACLs according to the Samba 4 Wiki.
    When a user opens a compressed folder (a.k.a. Zip file) on Windows 7, then tries to copy the files into a shared folder on the Samba 4 server using drag & drop, only one to four files is actually copied, and the copy process silently fails. If the user waits about 2 minutes, then they can move all of the files without issues. Also, if the user is able to copy all files, when they try to delete the newly created folder they get an error: Thumbs.db cannot be deleted because it is open in Windows Explorer.
    So, the root of the cause seems to be Windows Explorer locking files for too long. But I don't understand this enough to fix it.
    No errors appear in the...
    This topic first appeared in the Spiceworks Community

    "admiz" should be the account name anyway.
    When you do a Get Info on that in the Finder... what is locked, & Rights say?

Maybe you are looking for

  • How can i use cropping  in imovie 11 on the clips that i cut away with and still put it in HD

    Hi there, I do have one problem dealing with the videos I make in my iMovie 11: I want to set my videos to HD using Quicktime. I already know how to do that. But, the problem is that I use cropping and ken burn effects on my vids when I use cutaway (

  • Inconsistent selection behavior when deleting files in Cover Flow

    I love browsing through my pictures folder using Cover Flow. However, I've noticed that deleting a file by pressing Cmd-Delete produces inconsistent selection results. Sometimes Finder will select the next file down the list, and sometimes it will se

  • Mandatory Vendor field in BOM

    Dear SAPeers, I would like to make the vendor field in the purchasing view for the non stock item mandatory. Kindly suggest a feasible solution. Thanks and Regards Srinivasan R

  • Saving CF codes in a variable

    Hi, I am trying to save some rather lengthy CF codes in a variable, ie. <cfset mycode = " ... all the codes here ...">.  However the codes to be saved may contain double quotes (") which would create a conflict.  I know of cfsavecontent which does no

  • Live! webcam - VERY dark image

    We have a new Creative Live! webcam. The picture generated by this camera is VERY VERY dark. We've tried using the driver from the CD and from the Creative website; different versions of the Webcam Center software; manually adjusting brightness, cont