AppleScript and OS X server
AppleScript and OS X server
- Subject: AppleScript and OS X server
- From: Doug Watkins <email@hidden>
- Date: Fri, 13 Jul 2001 08:23:00 +1000
I have used the following script to change access privileges on an
ASIP 6.3.3 server.
The script runs on a client (with file sharing turned on) where the
server is mounted on the desktop using the admin login. The server
hard drive contains a sharepoint called "Data" which is owned by the
admin user with full read/write access.
Each folder in the "Data" folder contains a user folder with the
folder name the same as the ASIP user name. When the script is run
the "Teachers" group becomes the owner of the folder with R/W access,
the user becomes the User/Group owner with R/W access and Guest
access is denied.
tell application "Finder"
activate
set folderList to folders in folder "Data" of disk "Server" as list
if folderList is {} then --no folders selected
display dialog "No folders selected"
else
repeat with theFolder in folderList
open sharing window of theFolder
tell theFolder
set privileges inherited to false
set protected to false
set the owner to "Teachers" -- set
Teacher Group as owner (already has R/W privileges)
set the group to the name of
theFolder -- set student as Owner/Group with full access
set see folders of group privileges to true
set see files of group privileges to true
set make changes of group privileges to true
set see folders of guest privileges
to false -- disable Guest access
set see files of guest privileges to false
set make changes of guest privileges to false
end tell
close sharing window of theFolder with OK
end repeat
end if
end tell
After logging on to our OS X server as the admin user from a client
(OS 9.1) I can open the sharing window for a folder and change the
access privileges (although not the owner name) just like I can with
ASIP 6.3.3.
I then tried running the script and the sharing window opens as
expected but the error:
"Finder got an error because *Ox/it/* cannot be found"
is generated in the line "set the owner to "Teachers" " .
I would appreciate any assistance or comments
regards
Doug Watkins
Bendigo
Australia
--
------------------------------------------------------------------------------
Doug Watkins email: email@hidden
Office Everything Bendigo www:
http://www.oe.com.au
Education Consultant phone: +61-3-5442 4666
fax:+61-3-5443 8127
------------------------------------------------------------------------------