Please help !

Hi everyone

As you can see from my script, I am creating a folder with the current date and then copying a folder to it.

I cannot get the script to create the folder within another folder, I have tried various things but none of them appear to work.

Here is the script -

tell application “Finder”
set the_date to current date
set the_year to year of the_date
set the_month to month of the_date
set the_day to day of the_date
set folder_name to “” & the_month & “-” & the_day & “-” & the_year
set destFolder to make new folder at disk “My Disk” with properties {name:folder_name}
duplicate folder “My Folder” of desktop to destFolder
end tell

Thanks for any help

Ian.

Hi,

Your script works for me and I cannot think of why it wouldn’t work for you. I created a folder at the desktop named “My folder”. Then I made a disk image at desktop (this doesn’t matter). I mounted the image file (whose name is “My Disk”). Ran your script and it created the folder within the disk image and also the folder “My Folder” Within theat folder. . The only thing I can thiknk might go wrong is the names.

Sorry couldn’t be of more help. At least you know that your script works.

gl,

I’m not quite sure what you’re looking to do but perhaps this code will help:

Jon


[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]

Thank you both for your replies…

I don’t think I made myself clear, the script works for me BUT…

I want the folder (with current date) to be created inside a sub folder and not on the top level of my disk and I can’t seem to get the syntax right :?

The copying of the dektop folder is no problem at all.

Thanks for your help

Ian.

That’s what I thought which is why I provided code which demonstrates making folders inside of other folders (testing for their existence first).

Jon

Thanks ever so much Jon

Cheers

Ian. :stuck_out_tongue: