I can only test this on a afp volume, but I think it should work ok.
(*path to smb *)
property theDisk : ":Macintosh Hd:Volumes:TEST"
(*path to text folder *)
property theTextfilePath : "/Users/username/Desktop/TextFolder/"
(* text file name *)
property theTextfile : "Untitled.txt"
(*get folder list*)
tell application "Finder"
set Smb_list to name of every folder of entire contents of alias theDisk
end tell
(*get list from file *)
set text_list to paragraphs of (do shell script "cat " & quoted form of (theTextfilePath & theTextfile as Unicode text))
(*compare lists *)
repeat with i from 1 to number of items in text_list
set this_item to item i of text_list
if this_item is in Smb_list then
(*add an (x) to end of item in text list if the folder name is found in the smb list *)
set item i of text_list to (this_item & "(x)" & return as string)
else
set item i of text_list to (this_item & return as string)
end if
end repeat
set text_list to text_list as string
(*make a new text file, with the updated list *)
set text_check_list to (do shell script "echo " & quoted form of text_list & " > " & quoted form of (theTextfilePath & "checked_" & theTextfile as Unicode text))
Sorry for the delay.
Thanks for the reply & code, although I havn’t been able to test the script yet as the task has been pushed back a little while:rolleyes:. I will post with the outcome and ammended script (should it need amended) just as soon as I can.
As for the purpose of the script, the numbers relate to user home drives, I need to whittle out the old from the current and returning users before we migrate to a new domain.