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

Re: Help with move file script


  • Subject: Re: Help with move file script
  • From: KOENIG Yvan <email@hidden>
  • Date: Tue, 19 Dec 2006 21:45:50 +0100


Le 19 déc. 06 à 21:01:06, david okner a écrit :

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

I assumes that this line is the wrongdoer:

-- 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!

It would be useful to make other changes:

on adding folder items to InPut after receiving theFiles
set P2D to (path to desktop folder) as Unicode text
tell application "Finder" to repeat with indvFile in theFiles

set fileName to name of indvFile as Unicode text

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

try
if fileName contains "RHP" then
move indvFile to folder P2D & "RHP:" with replacing
else if fileName contains "LHP" then
move indvFile to folder P2D & "LHP:" with replacing
else
move indvFile to folder P2D & "Unknown:" with replacing
end if
end try
end repeat
end adding folder items to

With them it will not be dedicated to a single boot volume.

Yvan KOENIG _______________________________________________
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
References: 
 >Help with move file script (From: david okner <email@hidden>)

  • Prev by Date: Help with move file script
  • Next by Date: Re: strings and strings (was Don't get it.)
  • Previous by thread: Help with move file script
  • Next by thread: Apply script to subfolders, save file to new folder
  • Index(es):
    • Date
    • Thread