at least you will get an error in case two or more items are selected because selection returns always a list
Try this
tell application "Finder"
repeat with anItem in (get selection)
set label index of anItem to 1
if class of anItem is folder then
set label index of every item of entire contents of anItem to 1
end if
end repeat
end tell
I guess the “Network File permission error” is an access privilege error on a shared volume
Also, I have checked the sharing and permissions and made sure that the folder has read and write and applied to enclosed items.
Q: Is there a way to get the name of the file/folder that is causing the error?
tell application "Finder"
repeat with anItem in (get selection)
set label index of anItem to 1
if class of anItem is folder then
set label index of every item of entire contents of anItem to 1
end if
end repeat
end tell
This edited script is supposed to tell you which folder issue an error.
tell application "Finder"
repeat with anItem in (get selection)
set label index of anItem to 1
if class of anItem is folder then
try
set label index of every item of entire contents of anItem to 1
on error
display dialog "Error when treating folder : " & anItem
end try
end if
end repeat
end tell
KOENIG Yvan (VALLAURIS, France) mardi 30 juillet 2013 21:11:23
Yes. I’m aware that the code didn’t deal with permissions or finder related. What I was stating was that using the finder it doesn’t recursively unlock all the files which I assumed that the permissions would inherit. The specific reference was based on my observation to resolve the original error. Since the error was more related to permission level/finder rather than any script/code related error.