• 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
Help with move file script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Help with move file script


  • Subject: Help with move file script
  • From: david okner <email@hidden>
  • Date: Tue, 19 Dec 2006 12:01:06 -0800 (PST)

Hey everyone,

I am trying to move files with specific names in the file name to specific folders.

I can do it when it is only a file but if its nested within a folder my script doesn't work.

Here is what I have so far:

on adding folder items to InPut after receiving theFiles

    tell application "Finder" to repeat with indvFile in theFiles

        set fileName to name of indvFile as text

        set fileName to name of (get every item of folder thisFolder)

        try
            if fileName contains "RHP" then
                move indvFile to folder "Macintosh HD:Users:David:Desktop:RHP:" with replacing
            else if fileName contains "LHP" then
                move indvFile to folder "Macintosh HD:Users:David:Desktop:LHP:" with replacing
            else
                move indvFile to folder "Macintosh HD:Users:David:Desktop:Unknown:" with replacing
            end if
        end try
    end repeat
end adding folder items to

Any help would be greatly appreciated!

Thanks!

David




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Help with move file script
      • From: KOENIG Yvan <email@hidden>
  • Prev by Date: Re: Applescript mounting servers and finder
  • Next by Date: Re: Help with move file script
  • Previous by thread: RE: Applescript mounting servers and finder
  • Next by thread: Re: Help with move file script
  • Index(es):
    • Date
    • Thread