• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: A question on System prefs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A question on System prefs


  • Subject: Re: A question on System prefs
  • From: Jake Pietrykowski <email@hidden>
  • Date: Thu, 24 Feb 2005 14:18:03 -0600

Francois,

> On 2/24/05 1:15 PM, "francois.houle" wrote:
>
> Again questions...
>
> Basically what I want to do is to activate Apple remote Desktop in the
> System Prefs Sharing pane. I tried with GUI scripting:
>
> tell application "System Preferences"
>             activate
> Set current pane to pane "Sharing"
>
> But that won't work... Always gives me errors saying that its an invalid
> action or something... But as I stated above, then end idea is to activate
> ARD... Any one have an idea how to do that ? Ideally without having to use
> GUI scripting... Or if its in GUI scripting, I'll need to find how to make
> System Prefs invisible while it does that.
>
> Thanks

I would also suggest this:

"Try changing "Sharing" to "com.apple.preferences.sharing" as Ernie
did...but the brutal honest truth is that calling pref panes in this manner,
do not work for every pane. (I tried this way, but I think the sharing pane
is called sharingPref, but I couldn't get it to work)

For example:

set current pane to pane "com.apple.preference.keyboard" --works OK

vs.

set current pane to pane "com.apple.preference.sharing" --does NOT work

I like to navigate the System Preferences by using the "View" menu, as it
requires much less scripting, and achieves the desired result. I don't know
where ARD is activated from (I haven't used it), but perhaps you can tweak
the script below to fit your needs. The script below will activate "Personal
File Sharing" on your machine, or whichever service is first in the
'Services' list.

--code
tell application "System Preferences"
    activate
end tell

tell application "System Events"
    tell application process "System Preferences"
        click menu item "Sharing" of menu "View" of menu bar 1
        delay 3 -- delay is optional
        tell window "Sharing"
            tell tab group 1
                click radio button "Services"
                tell scroll area 1
                    tell table 1
                        tell row 1 --change row for desired service
                            click checkbox 1
                        end tell
                    end tell
                end tell
            end tell
        end tell
    end tell
end tell

ignoring application responses
    tell application "System Preferences" to quit
end ignoring
--/code

If you don't have the GUI scripting tools UIElementInspector or the PreFab
UI Browser, I would highly suggest checking those out. They can help very
much when AppleScripting MUST resort to using the GUI.

Best Regards,
Jake


 _______________________________________________
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

References: 
 >A question on System prefs (From: "francois.houle" <email@hidden>)

  • Prev by Date: Re: A question on System prefs
  • Next by Date: Quark 6 Move
  • Previous by thread: Re: A question on System prefs
  • Next by thread: Re: A question on System prefs
  • Index(es):
    • Date
    • Thread