Re: File sharing quits by itself
Re: File sharing quits by itself
- Subject: Re: File sharing quits by itself
- From: "Marc K. Myers" <email@hidden>
- Date: Sun, 4 Jan 2004 16:51:08 -0500
I got no responses to this message from Friday but I managed to come up
with a solution using UI Scripting. In case someone else might benefit
from it I'll post it here. When file sharing shuts itself down I
access my remote machine via SSH and run this script:
do shell script "open
/System/Library/PreferencePanes/SharingPref.prefPane"
tell application "System Events"
if (system attribute "sysv") < 4144 or UI element enabled then
tell application process "System Preferences"
try
--click "Personal File Sharing" in services list
tell text field 1 of row 1 of table 1 of scroll area 1
of tab group 1 of window "Sharing"
set pos to position as list
set siz to size as list
set x to item 1 of pos
set y to item 2 of pos
set width to item 1 of siz
set height to item 2 of siz
click at {x + width / 2, y + height / 2}
end tell
end try
try
--click the button to start file sharing
click button "Start" of tab group 1 of window "Sharing"
end try
end tell
else
tell application "System Preferences"
activate
set current pane to pane
"com.apple.preference.universalaccess"
beep
display dialog "GUI Scripting is not enabled." & return &
return & "Check \"Enable access for assistive devices\" in the
Universal Access preference pane (authentication is required), then run
this script again." with icon stop buttons {"OK"} default button "OK"
end tell
end if
end tell
Marc [01/04/04 3:20:12 PM]
--
"I lived through the 60s, man, when the universe meant something."
-- Tommy Chong
Subject : File sharing quits by itself
To: email@hidden
From: "Marc K. Myers" < email@hidden >
Date:
Fri, 2 Jan 2004 17:38:12 -0500
I'm having a problem with my G4 tower running OS X 10.2.8. For no
discernible reason file sharing tends to turn itself off at random
intervals. This made it impossible to access files on the machine
from remote locations.
Since this started I've learned to use SSH, which gives me access to
the files and also enables running applications. This gives me a
workaround but is not nearly as convenient as file sharing. I'm
wondering if there might be a way to use SSH and a script to get file
sharing up and running again. I've already tried using SSH to fire up
AppleFileServer. This works but still doesn't restore file sharing
functionality. There must be some other step I don't know about.
When I bring up the Sharing pane of System Preferences on the machine
after starting up AppleFileServer remotely I see that the checkbox
next to Personal File Sharing is checked but the text by the button
says file sharing is off. If I select any of the other services in
the list and then Personal File Sharing, file sharing starts up >
again.
Has anyone got a suggestion as to how I might accomplish the same
thing remotely?
Marc [01/02/04 5:38:04 PM]
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.