Maybe not, because you only have to run one check at each level. I just picked up where we left off so this could probably be shortened:
set my_chosen_folder to (choose folder with prompt "Choose a folder to check its sharing status…")
set P to quoted form of (characters 1 thru -2 of (POSIX path of my_chosen_folder) as string)
if length of (do shell script "/usr/bin/dscl . search /SharePoints dsAttrTypeNative:directory_path" & space & P) is not 0 then
display dialog "The folder \"" & (name of (info for my_chosen_folder)) & "\"" & space & "is shared." buttons {"OK"} default button 1
else
tell application "Finder"
set P to container of my_chosen_folder
end tell
try
repeat
set Q to quoted form of (characters 1 thru -2 of (POSIX path of (P as alias)) as string)
if length of (do shell script "/usr/bin/dscl . search /SharePoints dsAttrTypeNative:directory_path" & space & Q) is not 0 then
display dialog "The folder \"" & (name of (info for my_chosen_folder)) & "\"" & space & "is shared." buttons {"OK"} default button 1
exit repeat
end if
tell application "Finder"
set P to container of (P as alias)
end tell
end repeat
on error er
display dialog "The folder \"" & (name of (info for my_chosen_folder)) & "\"" & space & "is not shared." buttons {"OK"} default button 1
end try
end if
------
Laine Lee