Trying to fix up a broken SL script to work with Lion

I'm a totally new to applescripting. I'm trying to fix the code below that changes the sensitivity of my mouse in system preferences. It's these two lines that don't work"\:
=======
click menu item "Mouse" of menu "View" of menu bar 1
delay 2
set value of slider "Tracking Speed" of window "Mouse" to trackingValue
=======
Heres' the entire script:
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 & 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:" & return & theError) buttons "OK" default button "OK"
         end try
    end tell
end tell

OK, I was able to figure it out:
--Decrease mouse sensitivity to a value of 2
--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 & Mouse" pane
            click menu item "Mouse" of menu "View" of menu bar 1
            delay 0.5
            click radio button "Point & Click" of tab group 1 of window "Mouse"
            set value of slider 1 of tab group 1 of window "Mouse" to 2
        on error theError
            --An error occured
            display dialog ("Sorry, an error occured while altering Keyboard and Mouse settings:" & return & theError) buttons "OK" default button "OK"
        end try
    end tell
end tell

Similar Messages

  • My phone doesn't ring when someone is calling, but the sound works otherwise, like the alarm etc. I have tried to fix it in settings but still not working. anyone else have this problem?

    my phone doesn't ring when someone is calling, but the sound works otherwise, like the alarm etc. I have tried to fix it in settings but still not working. anyone else have this problem?

    Thanks so much but none of that helped.  It was driving me crazy because it would back up another external drive.  I just changed the name of the drive from iPhoto/iTunes Library to Media Libraries and IT WORKED!! I guess for some reason it didn't like the drive being called iPhoto or iTunes ???? I don't understand but I have tried so many solutions and exchanging things out but the name change did it????!!!
    Thank you for your help and replying to this.  Guess I made my own issue!

  • I had this video file and I was trying to flip it to a format that would work with iMovie.  It used to have the Quicktime image with it.  So, I assume it was a QT file.  But, somehow I've changed the file from a video to a folder.

    I had a video file and I was trying to flip it to a format that would work with iMovie.  It used to have the Quicktime image with it.  So, I assume it was a QT file.  But, somehow I've changed the file from a video to a folder.  I've tried to undo the action.  No luck.  I wasn't running my Time Machine.  So, I can't go back.  Help.  It's the only copy of this video.

    I've tried to undo the action.
    How?
    Please detail ALL you have done so far in the way of troubleshooting?   Need this info to avoid the been there done that scenarios.
    it's the only copy of this video.
    Where did you get the video from?
    From the pic I noticed that the folder is 841.9mb.  What's inside?  Or what happens when you click on it?

  • [svn:osmf:] 13494: Update build script to work with Flex 4 SDK.

    Revision: 13494
    Revision: 13494
    Author:   [email protected]
    Date:     2010-01-13 20:30:13 -0800 (Wed, 13 Jan 2010)
    Log Message:
    Update build script to work with Flex 4 SDK.
    Modified Paths:
        osmf/branches/flex4/build/build.xml

    No, you don't need Flash Builder to use the Flex SDK. If you download the SDK and unzip it, you'll find a 'bin' directory that has the mxmlc compiler in it. You can compile Actionscript or MXML files using that.
    ./mxmlc MyFlexApp.mxml
    If you are building an AIR application, you will use amxmlc
    ./amxmlc MyAIRFlexApp.mxml
    Then, launch your AIR application using adl
    ./adl.exe MyAIRFlexApp-app.xml
    Hope this helps,
    Joan

  • How to get this script to work with different browser

    Do you guys know how to get this script to work with mozilla firefox? 
    do shell script "open -a safari 'https://login.binck.nl/klanten/Login.aspx?ReturnUrl=%2fklanten%2fdefault.aspx'"
    tell application "Safari"
      activate
              tell document 1
                        repeat until ((do JavaScript "location.host") is "login.binck.nl")
                                  delay 1
                        end repeat
      do JavaScript"document.getElementById('ctl00_Content_Gebruikersnaam').value='sim';document.ge tElementById('ctl00_Content_Wachtwoord').value='password';window.open(document. g etElementById('ctl00_Content_LoginButton').href, '_self', 'true');"
              end tell
    end tell
    Thank you so much in advance:)

    That isn't possible. Firefox's AppleScript dictionary doesn't contain anything which can be used to manage JavaScripts.
    (63741)

  • Script Help - Working with Files - Reading/Writing

    Hey Folks,
    I need help build a script that will read a text string from a specific .INI file, and then write that string to a file along with the name of the computer where the string originated from.
    I plan on deploying this script to our targeted workstations with SCCM 12, so it does not need recursive abilities. We want each of the machines which run the script to write their data to a single file with a date stamp as part of the name. The data written
    needs to include the unique string which follows this format "devicename=DJ########", along with the computer's name. The device name which needs to be extracted starts with DJ and is followed by an 8 digit number. It would be better if we could
    use export-csv than out-file. 
    This is what my very inexperienced self came up with so far:
    get-content 'C:\users\Public\Something\myfile.ini' | Select-String devicename=dj | out-file
    \\server\folder\data.txt -append
    I
    found this bit of code which should allow me to set the file name to a date, but I am unsure exactly how to implement this:
    $enddate = (Get-Date).tostring("yyyyMMdd")
    $filename = 'C:\Documents and Settings\User\Desktop\' + $enddate + '_VMReport.doc'
    $filename
    The developer of a core piece of software requires all computers have a unique ID, but provides absolutely no tools or guidance for tracking this crucial information. Any input you can provide will be greatly appreciated!
    Please help us fix this nightmare! Thank you in advance!

    I am trying to add a step where the script grabs a list of all domain workstations and saves it to a file. This file is then used as the input for the rest of the script. There is a problem with the way the computers names are imported using this method.
    Here is the script:
    # Rename the existing DJNumbers.csv to yesterday's date
    $date = (Get-Date).AddDays(-1)
    Rename-Item -Path '\\Server\Library\DJs\DJnumbers.csv' -NewName ("DJNumbers_{0}.csv" -f (Get-Date $date -Format yyyy-MM-dd))
    #Save a list of all current AD computers
    Get-ADComputer -Filter * | select name | Out-File \\Server\C$\DJs\complist.csv
    #Extract the DJ number for every computer in complist.csv
    Get-Content '\\Server\C$\DJs\complist.csv' |
    ForEach-Object {
    $devicename=get-content "\\$_\C$\Users\Public\myfile.ini" | Select-String devicename=
    $djnumber=$devicename -replace "devicename=","`t"
    $prize=$_ += $djnumber
    $prize | Out-File \\Server\Library\DJs\DJnumbers.csv -Append
    The problem is that the computer names include a ton of blank spaces if I use Out-File in the line:
    #Save a list of all current AD computers
    Get-ADComputer -Filter * | select name | Out-File \\Server\C$\DJs\complist.csv
    Error looks like this:
    get-content : Cannot find path '\\CM112233
    \C$\Users\Public\Software\myfile.ini' because it does
    not exist.
    At line:11 char:13
    + $devicename=get-content "\\$_\C$\Users\Public\Software\...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (\\CM112233 ...ction\myfile.ini:String) [Get-Content], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand
    If I use Export-Csv, it puts ""'s around the computer names and that breaks it as well.
    #Save a list of all current AD computers
    Get-ADComputer -Filter * | select name | Export-Csv \\Server\C$\DJs\complist.csv
    This is the error:
    get-content : Illegal characters in path.
    At line:11 char:13
    + $devicename=get-content "\\$_\C$\Users\Public\Software\ ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidArgument: (\\"CM112233"\C$\U...are\myfile.ini:String) [Get-Content], ArgumentException
    + FullyQualifiedErrorId : ItemExistsArgumentError,Microsoft.PowerShell.Commands.GetContentCommand

  • [js] CS Scripting not working with CS3

    Hello,
    We had a JavaScript made for us that enabled the user to exchange certain text within a document.
    This script works fine with CS (Ver.3.0.1) but gives a JavaScript Error - #55, Error String: Object does not support the property or method 'findPreferences' with CS3 (Ver.5.0)
    I have tried 'tinkering' around with the scripting - but I have zero experience with JavaScript and have not found a solution.
    Additionally the people that wrote the initial script are not available.
    I have bought several books but they all seem like alien-language to me
    Below is the section of origional CS scripting.
    Can anyone point out to me WHY this script does not work with CS3?
    And WHERE I should start looking - changing?
    Thanks in advance for your help and guidence.
    Lee
    // Exchange the text
    function actProjectData(oneDoc, oneResult){
    app.findPreferences = null; app.changePreferences = null;
    oneDoc.search(undefined, true, true, oneResult[0],{appliedCharacterStyle:oneDoc.characterStyles.item(myProjectTitleCharStyleNa me)}, undefined);
    oneDoc.search(undefined, true, true, oneResult[1],{appliedCharacterStyle:oneDoc.characterStyles.item(myOfferNoCharStyleName)}, undefined);
    oneDoc.search(undefined, true, true, oneResult[2],{appliedCharacterStyle:oneDoc.characterStyles.item(myOfferDateCharStyleName) }, undefined);
    app.findPreferences = null; app.changePreferences = null;

    > Come to think of it, maybe it's easier to create a folder "Version 4.0 Scripts" under your scripts folder and place your CS script in there. Maybe that will do the trick. Should have thought of that earlier.
    Tried this, but it didn't seem to do anything... But certainly a 'try' worth.
    Currently playing around with the:
    > app.findTextPreferences.findWhat = "a";
    app.changeTextPreferences.changeTo = "b";
    oneDoc.changeText();
    I've got to the point where I have no error messages :-) Now I'm really flying.....
    Fact is - not all text and also the wrong text is replaced!!!
    I'm currently playing with the script to try and replace
    all texts with a given paragraph style with the entered text...
    Not proving to be simple for me, but I'm learning rather a lot!
    Now that doesn't sound very clear when I go back and read it!
    What I want to say is:
    Each page of the document has the project name, No & Date on it (each having their own paragraph style)
    so
    With this script it asks you the Project name, No. and Date and then goes
    through the whole document and replaces all instants of those texts with specific paragraph styles with the newly 'entered' text.
    Proving to be a little mountain for me - Thought it would only be a hill!

  • Help getting a Photoshop CS4 script to work with PS CS5?

    I don't know AppleScript, but have a script for Photoshop CS4 that saves to the currently open image as a .png file on the desktop
    try
    tell application "Adobe Photoshop CS4"
    activate
    --get the current document name
    set myDoc to the current document
    set currentName to name of myDoc
    --remove .psd extension
    set docBaseName to (items 1 thru ((length of currentName) - 4) of currentName) as string
    --write the temporary file
    set theFile to "~/Desktop/" & docBaseName & ".png"
    --save the temp document
    save myDoc in theFile as PNG with options {class:PNG save options} appending lowercase extension with copying
    end tell
    end try
    Now that Photoshop CS5 is out I tried changing the script above from
    +tell application "Adobe Photoshop CS5"+
    to
    +tell application "Adobe Photoshop CS5"+
    But this doesn't work. Is there any way of changing it to get it to work with Photoshop CS5?

    Not able to help but I have seen problems posted with CS5 & AppleScript already at Adobe's forums…
    See link:
    http://forums.adobe.com/thread/632681?tstart=0

  • Does anyone have a fix for getting the facetime camera to work with Skype?

    I have been trying to skype with my daughter on my iMac, intel.  I've downloaded 7.0.02 ... the newest OS.  The camera will not work with Skype.  Any fixes yet, Apple?

    Have you posted this in Skype forums? 

  • Modify shell script to work with other folders

    i am trying to modify a shell script that sorts files in a course folder into sub folders by month. I have a shell script that works, but when i try to modify it for another course folder it quits working. can someone let me know what i am doing wrong?
    the working shell script:
    do shell script "
    for f in \"$HOME/Desktop/DWI Annual Report/\"*
    do if [ ! -d \"$f\" ]; then
    x=\"${f%%.*}\"
    i=$((${#x}-3))
    if [ -d \"$HOME/Desktop/DWI monthly/${f:$i:3}\" ]; then
    mv \"$f\" \"$HOME/Desktop/DWI monthly/${f:$i:3}\"
    fi
    fi
    done"
    the nonworking modified script:
    do shell script "
    for f in \"$HOME/Desktop/DOEP Annual Report/\"*
    do
        if [ ! -d \"$f\" ]; then
            x=\"${f%%.*}\"
            i=$((${#x}-3))
            if [  -d \"$HOME/Desktop/DOEP monthly/${f:$i:3}\" ]; then
                mv \"$f\" \"$HOME/Desktop/DOEP monthly/${f:$i:3}\"
            fi
        fi
    done"

    ok here is the applescript that works.
    property total_student : 1
    tell application "Finder"
      set master_path to alias "Users:macbook:Desktop:DWI Annual Report:Annual Report.xlsx"
      set filesWithDWI to get every file of folder ((path to desktop folder) & "DWI Annual Report" as string) whose name contains "DWI"
      repeat with f in filesWithDWI
      my transfer_data(f, master_path)
      end repeat
    end tell
    on transfer_data(child_path, master_path)
      tell application "Microsoft Excel"
      set child_book to (open workbook workbook file name (child_path as string))
      set child_doc to worksheet 1 of child_book
      set master to worksheet "sheet 1" of (open workbook workbook file name (master_path as string))
      set num to 15 --All lists start at index 12 or later, I'm putting 10 to be safe
      set students to {}
      tell child_doc --grab values from child document
      repeat until (value of cell (("A" & num) as string)) is 1
      set num to num + 1
      end repeat
      repeat until (value of cell (("B" & num) as string)) is ""
      set end of students to {namevalue of cell (("B" & num) as string)), driver_idvalue of cell (("C" & num) as string)), DOBvalue of cell (("D" & num) as string)), Ref_Recvalue of cell (("I" & num) as string)), pre_testvalue of cell (("J" & num) as string)), post_testvalue of cell (("K" & num) as string)), cert_idvalue of cell (("L" & num) as string))}
    set num to num + 1
      end repeat
      set startdate to range "C7"
      set classlocation to range "C11"
      set instructor to range "H7"
      end tell
      tell master
      set num to 7
      log (value of cell (("B" & num) as string))
      repeat until (value of cell (("B" & num) as string)) is ""
      set num to num + 1
      end repeat
      repeat with student in students
      set value of cell (("A" & num) as string) to total_student
      set value of cell (("B" & num) as string) to name of student
      set value of cell (("C" & num) as string) to driver_id of student
      set value of cell (("D" & num) as string) to DOB of student
      set value of cell (("H" & num) as string) to pre_test of student
      set value of cell (("I" & num) as string) to post_test of student
      set value of cell (("J" & num) as string) to cert_id of student
      set value of cell (("f" & num) as string) to startdate
      set value of cell (("E" & num) as string) to classlocation
      set value of cell (("G" & num) as string) to instructor
      set value of cell (("K" & num) as string) to Ref_Rec of student
      set num to num + 1
      set total_student to total_student + 1
      end repeat
      end tell
      save child_book
      close child_book
      save active workbook in master_path
      close active workbook
      end tell
    end transfer_data
    do shell script "
    for f in \"$HOME/Desktop/DWI Annual Report/\"*
    do
        if [ ! -d \"$f\" ]; then
            x=\"${f%%.*}\"
            i=$((${#x}-3))
            if [  -d \"$HOME/Desktop/DWI monthly/${f:$i:3}\" ]; then
                mv \"$f\" \"$HOME/Desktop/DWI monthly/${f:$i:3}\"
            fi
        fi
    done"
    It takes the class rosters and copies the information from the class roster to the annual report and then moves the file to the monthly  folder and files it in the appropriate months folder based on the last three letters of the file name.

  • How can I fixed my photos on the website? work with dreamweaver cc.

    How can I fixed my photos on the website. work with DW CC.     be happy for your help.

    IMage manipulation requires an image editing tool like Photoshop.
    Mylenium

  • My airport express seems to no longer be supported by Apple. Was working fine, just blinking amber. So tried to update and reset, but update will not install with Lion? Im disgusted.

    Airport express was blinking yellow. Tried to update, but my computer said update is not supported (yellow exclamation points). I have a mac pro with Lion and latest updates. So I reset express, yes that was a mistake because it was at least functioning on my stereo, now it does not function at all and shows on my wifi as "airport express", used to be labled "stereo". So it asks for an update, I download the update, but computer will not allow update to be installed. I will buy a newer one if I have to because I enjoy it's function, but I will be extremely disgusted with Apple to have to do so.

    If you are using Lion...as you indicate...is it possible that you mistakenly downloaded the incorrect version of AirPort Utility?
    Try the following version for Lion:
    AirPort Utility 5.6 for Mac OS X Lion

  • When is apple going to fix the fact that icloud no longer works with microsoft outlook?

    When is apple going to fix icloud so that it works with microsoft outlook again? 

    I am talking about everything i have lost since downgrading to IOS6.  My contacts and calendar no longer sync with my outlook 2010!!!!! .....and I can't downgrade to IOS 5 because apple has deleted that version.  thanx APPLE for nothing!

  • ACROBAT STARTUP SCRIPTING NOT WORKING (with extendscript Tooklkit CS6)

    Hi
    I experienced in programming, but newbie in JS-Scripting in CS6.
    I have developed some scripts in the console of Acrobat XI Pro, now I wan't to install that global script callable by a menu.
    I work on Windows-7, with 64bit:
    The script path is:
    C:\Program Files (x86)\Adobe\Acrobat 11.0\Acrobat\Javascripts
    script name is Confg.js
    The script is created with Extendscript Tooklkit CS6 editor
    only contains this line:
    app.alert("Hi, from a globally executed script");
    I expect that an alert is poping up, when I open the Acrobat XI Pro with any PDF-File:
    for a change
    app.addMenuItem({cName:"Menu Test", cParent: "Help",   cExec: "app.alert('Menu Item Test'); "});
    doesn't work either
    after opening PDF XI Pro with an arbitry PDF I get an error in the console:
    Acrobat – Version mit integrierten EScript-Funktionen 11.0
    Acrobat SOAP 11.0
    SyntaxError: illegal character
    1:Folder-Level:App:Config.js
    If I create the file with a plain text editor, things will work fine, as expected.
    If I edit that clean file with Extendscript Tooklkit CS6 editor again the file is corrupted. This is rahter clumsy. Any solution, so I can work with Extendscript Tooklkit CS6 editor?

    Thanks for the reply.
    >>Acrobat is not one of listed programs that Extendscript is used with.
    I was already wondering about this. Thought my installation is corrupted or whatever
    Though with regret, I have to accept that Extendscript Toolkit can't be used with Acrobat XI scripting. I use jEdit meanwhile. This has syntax higlighting and a linenumbering, helpful to spot errorous linenumbers. This does the job so far.

  • UDM and shell scripts and working with the ENVIRONMENT variable options

    In Userdefined metrics you have the ability to pass envronment variables.
    I was going to send
    DIR=/db/db05/oradata/ORCL/hot
    How to handle whats passed to the shell script?
    It passes $1 as {DIR=/db/db05/oradata/ORCL/hot}
    yes with the brackets. Here I figured it would simply set the DIR environment variable.
    Any cool tricks to work with this mess?
    Is it meant for perl scripts instead?
    Daryl.

    Ilmari Aalto wrote:
    Hi Darth,
    Thanks for your hint! Nevertheless I think it's something more profound, since there's no error etc. For example, should I have the path wrong I assume that OWB would return me some kind of an error when it doesn't find the .sh-file? Isn't there any log-file to see whether the command was executed? It seems like the execution of the User Defined element would be skipped altogether.
    Cheers,
    IlmariNo, if you don't give an absolute path OWB will not return any error, it just wont do anything at all...

Maybe you are looking for

  • Turn off all Adobe Services and Cloud

    Hi Everyone, I had an Academic version of CS6 and after I changed jobs and was no longer eligible I purchased Creative Cloud for access to Photoshop.  I only want the Photoshop program and will save to a different location.  I also don't want the upd

  • HP m6-k025dx graphics issues after 8.1 update

    ok guys, so i updated to windows 8.1, and i thought i had all the stuff hp recommended, but i guess not because after the update, for some reason my graphics are acting funny. when i plug and unplug my laptop, the screen goes black for a second, like

  • Imported footnote from word won't be removed in indesign textbox

    I have such an annoying problem! I got a indesign doc from my client, they already imported the text (with styles) from word for me. But now, I keep having problems wit a footnotecontainer  that doesn't want to be deleted from my text box. It stays i

  • DropText: some edits do not 'stick'

    Just started using DropText, as I am disappointed at being unable to perform simple editing of TXT files in DropBox. But I am immediately baffled because some files refuse to accept my changes! For example, I make a change to Contacts.txt, tap Save a

  • Idoc type for Goods Receipt

    hi to all            I am new to XI and i am doing a scenario in which R/3 and SUS(Supplier Self-Service) is communicating through XI.            Now i want send goods receipt from R/3 to SUS.So my question is what should be Idoc type there on R/3 an