Moving files & creating folders to move them in.

Discussion in 'AppleScript' started by ajia, Jan 7, 2012.

  1. ajia

    ajia New Member

    Jan 7, 2012
    Likes Received:
    Just starting to create Applescripts with the responses found here.
    I have already created the move script, so that part is more of a question. Depending on the answer a new script may be needed.
    The question is, if a move script is always running & new files are placed in the watched folder, does the script wait until the file is stable before it starts to move the file?
    Also, I would like the files MOVED, not copied. And although the original move script only copied the file, I added a delete line. I'm wondering if the files might get deleted before they are completely moved.

    The AppleScript I have yet to create, if possible would be to create a folder based on the name of a file and then move subsequent files into the appropriate created folders.
    For example, the file is named SBSE_xxxxxxx_0108.
    The AppleScript would create a folder called 'SBSE_0108' and drop the file into that folder. Any other file that started with SBSE & ended with 0108 would be moved there as well.
    Another file comes in as is called WS_xxxxxx_0108.
    The script would create another folder called 'WS_0108' and do the same as above.

    Thanks guys for any help.
    ajia, Jan 7, 2012
    1. Advertisements

  2. ajia

    Kaveman New Member

    Nov 26, 2010
    Likes Received:
    Westland, NZ
    If you are using tell "Finder" and it all in the same script, copy then delete is ok, but use move.

     tell application "Finder"
    	move theFile to theDestinationFolder replacing true
    end tell
    Yes you can, get the file name, break it into parts, make the folder using the names and them move the files into it. These are the tasks AS is good at.
    Kaveman, Jan 9, 2012
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.