Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Two things here - firstly, you need to have checked the "<code>Enable access for assistive devices</code>" in <code>System Preferences / Universal Access / Mouse &amp; Trackpad</code>. Obviously you've already done this, otherwise the script wouldn't get to where it is without already failing, but it's an important step for anyone else trying to get this working.</p> <p>Secondly, the problem with the line you were receiving the error on was that you weren't telling the AppleScript where to find the slider you were wanting to change the value of. By changing the line to the following, the script started working:</p> <pre><code>set value of slider "Tracking Speed" of window "Mouse" to trackingValue </code></pre> <p>Note that as well as naming the window to be used by the AppleScript I have also named the slider to be used as well. Whilst running Snow Leopard and using "slider 1", the second slider in the window "Scrolling Speed" was being altered. So, by using the name of the slider rather than its number we bypass any possible indexing issues. As for working out the name of the slider? I simply tried using the value of the label that went with it, which worked in this instance. Your mileage may vary, of course.</p> <p>Thus, the final script becomes:</p> <pre><code>set trackingValue to 5 --Open and activate System Preferences tell application "System Preferences" to activate --Attempt to change settings using System Events tell application "System Events" tell process "System Preferences" try --Open the "Keyboard &amp; Mouse" pane click menu item "Mouse" of menu "View" of menu bar 1 delay 2 set value of slider "Tracking Speed" of window "Mouse" to trackingValue --end tell on error theError --An error occured display dialog ("Sorry, an error occured while altering Keyboard and Mouse settings:" &amp; return &amp; theError) buttons "OK" default button "OK" end try end tell end tell </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload