Sunday, 15 June 2014

osx - Apple Script to turn File Sharing off & on in one script -



osx - Apple Script to turn File Sharing off & on in one script -

i pulling hair out write script next in 10.8. :

-uncheck 'file sharing' in 'sharing' controlpanel

-check 'file sharing' in 'sharing' controlpanel

-make sure checked when script finishes

why want ? because there bug in 10.8. samba (cannot smb-login machine), if file sharing gets turned off on when starting up, fine.

can help me out on … ? should easy 1 guys :-)

thank much in advance, best- ph!l!pp

this code should toggle sharing preferences, wait 1 second, toggle them again.

tell application "system preferences" activate end tell tell application "system events" tell process "system preferences" click menu item "sharing" of menu "view" of menu bar 1 delay 2 tell window "sharing" click checkbox 1 of row 3 of table 1 of scroll area 1 of grouping 1 delay 1 if (exists sheet 1) if (exists button "turn airport on" of sheet 1) click button "turn airport on" of sheet 1 delay 1 end if click button "start" of sheet 1 end if end tell end tell end tell delay 1 tell application "system events" tell process "system preferences" click menu item "sharing" of menu "view" of menu bar 1 delay 2 tell window "sharing" click checkbox 1 of row 3 of table 1 of scroll area 1 of grouping 1 delay 1 if (exists sheet 1) if (exists button "turn airport on" of sheet 1) click button "turn airport on" of sheet 1 delay 1 end if click button "start" of sheet 1 end if end tell end tell end tell

osx applescript osx-mountain-lion file-sharing

No comments:

Post a Comment