Hello everybody!
Let’s begin specifying that I’m a perfect newbie with Applescript (Day 3, literally ) and that my english is a little (lot) rusty so… Be patient, please!
I’m looking for a way to automate a very annoying, periodical task…
The situation
======> ONE FOLDER [A] WITH HUNDREDS OF FILES IN IT
Every File in Folder [A] is named in the following way: nnnn_XXXXXXX.ext
where:
“nnnn” is an ID number (NOT unique);
“XXXXXXX” a simple name (not unique);
“ext” the file extension (not necessarily the same for all files).
i.e.
FOLDER [A]
0001_The cat.wav
0002_The dog.aiff
0003_The mouse.jpg
0003_The mouse.doc
0004_The monkeyA.wav
0004_The monkeyB.wav
0004_The monkey.jpg
0004_The monkey.xls
0005_The cat.wav
…
…
.
======> ANOTHER FOLDER [Z] WITH THOUSANDS OF FILES IN IT
- Every file in Folder [Z] is named in the following way: nnnn_ExampleNNN.wav,
where:
“nnnn” is an ID number (not unique, the same as in Folder [A]);
“Example” is a fixed text (always the same);
“NNN” a three digits sequential number (001, 002, 003, 004,…);
“wav” the File extension (always the same).
i.e.
FOLDER [Z]
0001_Example001.wav
0001_Example002.wav
0001_Example003.wav
0001_Example004.wav
0002_Example001.wav
0002_Example002.wav
0003_Example001.wav
0003_Example002.wav
0003_Example003.wav
0004_Example001.wav
0004_Example002.wav
0004_Example003.wav
…
…
.
I’ve already found and edited an Applescript to create - starting from an Excel or Text file containing the “nnnn_XXXXXX” names list - an array of Folders like that:
ARCHIVE
nnnn_XXXXXXX
PHASE_1
PHASE_2
PHASE_3
IMAGES
DOCS
nnnn_XXXXXXX
PHASE_1
PHASE_2
PHASE_3
IMAGES
DOCS
…;
This will be the starting point for the solution I’m looking for.
What I need
1a) Move WAV (extension wav/WAV) Files from Folder [A] to the right “PHASE_1” Folder (USING nnnn NUMBER AS REFERENCE), inside ARCHIVE Folder;
1b) Move EVERY OTHER SOUND Files (aiff/mp3/…) from Folder [A] to the right “PHASE_2” Folder (ALWAYS USING nnnn NUMBER AS REFERENCE), inside ARCHIVE Folder;
1c) Move IMAGE Files (jpg/tiff/…) from Folder [A] to the right “IMAGES” Folder (ALWAYS USING nnnn NUMBER AS REFERENCE), inside ARCHIVE Folder;
1d) Move EVERYTHING ELSE (doc/xls/…) from Folder [A] to the right “DOCS” Folder (ALWAYS USING nnnn NUMBER AS REFERENCE), inside ARCHIVE Folder;
- Move Files from Folder [Z] to the right “PHASE_3” Folder (ALWAYS USING nnnn NUMBER AS REFERENCE), inside ARCHIVE Folder;
With the example data used above, the final result would be something like that:
ARCHIVE
> 0001_XXXXXXX
> PHASE_1
0001_The cat.wav
> PHASE_2
> PHASE_3
0001_Example001.wav
0001_Example002.wav
0001_Example003.wav
> IMAGES
> DOCS
> 0002_XXXXXXX
> PHASE_1
> PHASE_2
0002_The dog.aiff
> PHASE_3
0002_Example001.wav
0002_Example002.wav
> IMAGES
> DOCS
> 0003_XXXXXXX
> PHASE_1
> PHASE_2
> PHASE_3
0003_Example001.wav
0003_Example002.wav
0003_Example003.wav
> IMAGES
0003_The mouse.jpg
> DOCS
0003_The mouse.doc
> 0004_XXXXXXX
> PHASE_1
0004_The monkeyA.wav
0004_The monkeyB.wav
> PHASE_2
> PHASE_3
0004_Example001.wav
0004_Example002.wav
0004_Example003.wav
> IMAGES
0004_The monkey.jpg
> DOCS
0004_The monkey.xls
> 0005_XXXXXXX
> PHASE_1
0005_The cat.wav
> PHASE_2
> PHASE_3
> IMAGES
> DOCS
...
..
.
Ehm… Lots of Blabla, I know… But I’m trying to explain the best as I can, hoping somebody can help…
:rolleyes:
Thanks in advance!!!