• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Replace files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Replace files
      • From: Michelle Steiner <email@hidden>
References: 
 >Re: Replace files (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Validate IP Address
  • Next by Date: Re: Validate IP Address
  • Previous by thread: Re: Replace files
  • Next by thread: Re: Replace files
  • Index(es):
    • Date
    • Thread