Re: Help with move file script
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