Re: Setting computer name
Re: Setting computer name
- Subject: Re: Setting computer name
- From: email@hidden
- Date: Wed, 14 Sep 2005 10:51:56 -0600
- Priority: normal
On Sep 14, 2005, at 2:11 AM, pete boardman wrote:
On 13 Sep 2005, at 22:03, email@hidden wrote:
tell application "System Preferences" to activate
tell application "System Preferences to set current pane to pane
"com.apple.preferences.sharing
tell application "System Events"
set value of text field 1 of window "Sharing" to compName
end tell
I'm stumped and stuck and would appreciate a shove in the right direction.
Looks like you're not actually targetting System Preferences at this
point. How about this:
tell application "System Preferences"
activate
set current pane to pane "com.apple.preferences.sharing"
end tell
tell application "System Events"
tell process "System Preferences"
set value of text field 1 of window "Sharing" to compName
end tell
end tell
Pete
Thanks, Pete. Your suggestion was right on.
Unfortunately, now I've hit a new snag: I can set the value of the box
holding the computer name and also the box with the .local name. Trouble
is, when I exit System Preferences, only the .local name is saved; the
name in the Sharing window reverts to what it was before the script
executes. I've tried adding a tab stroke but to no avail. My testing
seems to suggest that the box will only respond to keyDown events. When
that happens (like when I simply type in the text box) both the computer
name and the .local names are set. With AS, the former never gets set.
Why is this so difficult? Why isn't the computer name a property somewhere?
Thanks for any insight. BTW: I'm on 10.4.2.
Sorry, too, for the message threading and quoting; the insipid webmail
client I'm forced to use at work isn't up to the task of modern
messaging, apparently.
Jamey Osborne
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden