Moving files & creating folders to move them in.

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

  1. ajia

    ajia New Member

    Joined:
    Jan 7, 2012
    Messages:
    1
    Likes Received:
    0
    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
    1. Advertisements

  2. ajia

    Kaveman VIP Member

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

    Code:
     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
    #2
    1. Advertisements

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.
Similar Threads
  1. iluvpiano
    Replies:
    2
    Views:
    693
    iluvpiano
    Nov 28, 2011
  2. Paul Soderman
    Replies:
    3
    Views:
    145
    Calum Benson
    Mar 19, 2006
  3. Harry Solomon
    Replies:
    2
    Views:
    294
    Harry Solomon
    Dec 23, 2008
  4. yunity
    Replies:
    4
    Views:
    249
    Jennifer Mullen
    Oct 15, 2003
  5. Rory Molinari
    Replies:
    9
    Views:
    263
    Philo D
    Jan 2, 2004
  6. iPhone 3Gold
    Replies:
    3
    Views:
    384
    drewdawg
    Sep 27, 2008
  7. Woody

    If you cant beat them, sue them

    Woody, Sep 9, 2005, in forum: UK Macs
    Replies:
    1
    Views:
    273
    PeterD
    Sep 9, 2005
  8. Harry Solomon
    Replies:
    2
    Views:
    256
    Harry Solomon
    Dec 23, 2008
Loading...