0
votes

I am working on a script that will move the entire contents of a folder, including all subfolders and the files within, to another folder when I mount my bak drive.

Just for testing I wrote a simple script to check how I can do this (I don't really know AppleScript, so it's learn as I go), I used the following cmd in my applescript:

move every file of entire contents of folder "Lion:Users:dbooster:desktop:outbox" to "Lion:Users:booster:desktop:file"

So my test, as you can see is moving everything within a folder on my desktop called "outbox" into a folder called "file" on my desktop.

At first I thought it worked perfectly, but then I tried to put another folder within "outbox". What I discovered is this script moves all the files within that subfolder in "outbox", but it doesn't move the subfolder itself.

That is to say, if I test with outbox/stuff/file1.txt and run the script, the result is file/file1.txt, NOT file/stuff/file1.txt which is what I would expect.

Uhm... This seems like it should be easier than I am finding it. But I've been searching google for the past hour and can't come up with anything (maybe I'm searching for the wrong thing?) Any help would be appreciated -- thanks in advance.

1

1 Answers

3
votes

Try:

tell application "Finder" to move entire contents of folder "Lion:Users:dbooster:desktop:outbox" to folder "Lion:Users:booster:desktop:file"