Re: Replace files
Re: Replace files
- Subject: Re: Replace files
- From: Jim Hankins <email@hidden>
- Date: Sun, 12 Feb 2006 20:14:04 -0500
- Thread-topic: Replace files
Thanks,
And actually the class was to prevent the error when you have drive icons on
your desktop. (It sees them as folders but the folder class prevents it).
Jim
On 2/12/06 4:48 PM, "Michelle Steiner" <email@hidden> wrote:
> On Feb 12, 2006, at 2:00 PM, Jim Hankins wrote:
>
>> tell application "Finder"
>> if not (the folder "Old Desktop" of home exists) then
>> make new folder at home with properties {name:"Old Desktop"}
>> end if
>> move every file of the desktop to the folder "Old Desktop" of home
>> move (every folder of desktop whose class is folder) to the
>> folder "Old
>> Desktop" of home
>> end tell
>
> The answer is to use "with replacing".
>
> I cleaned up the code a bit to make it somewhat less verbose. I'm
> not sure why you included "whose class is folder", so I left it
> alone. I don't know of any folder whose class is not folder,
> though. An application bundle's class is application file, if that's
> what you were concerned about.
>
> tell application "Finder"
> if not (folder "Old Desktop" of home exists) then
> set oldDT to make new folder at home with properties {name:"Old
> Desktop"}
> else
> set oldDT to folder "Old Desktop" of home
> end if
> move files of the desktop to oldDT with replacing
> move (folders of the desktop whose class is folder) to oldDT with
> replacing
> end tell
>
> -- Michelle
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden