AppleScript Help

Discussion in 'Mac Help/Tips' started by idkew, Apr 25, 2003.

  1. idkew macrumors 68020

    idkew

    Joined:
    Sep 26, 2001
    Location:
    where the concrete to dirt ratio is better
    #1
    ok, i have sony ericsson clicker for my t68i, and i want to be able to control the SYSTEM volume, nut just iTunes' volume.

    so... here is my script:

    tell application "Finder"
    set realVolume to volume
    tell application "SEC Helper"
    enter slider mode title "Master Volume" steps 10 value realVolume
    end tell
    end tell


    on value_was_changed(newValue)
    tell application "Finder"
    set volume newValue
    my showOSDMessage("Volume = " & newValue & " %")
    end tell
    end value_was_changed

    on showOSDMessage(txt)
    tell application "SEC Helper"
    show screen message txt
    end tell
    end showOSDMessage


    ....


    so- my problem is that the script is seeting the volume in


    set realVolume to volume

    as a variable instead of the finder's volume. any ideas how i can get it to set my variable, realVolume, to the system's volume level so that I may adjust the master volume via my bluetooth phone?


    btw- can someone send me all their applescript os x apps? i guess i must have deleted them... no clue why, but they are gone... bnau@iwu.edu
     
  2. idkew thread starter macrumors 68020

    idkew

    Joined:
    Sep 26, 2001
    Location:
    where the concrete to dirt ratio is better
    #2
    this was on apple's site:

    --- This script lets you change the system volume.
    --- Credits go to Apple's Sal Soghoian.
    --- I just included it here as sone people had
    --- problems copying and pasting the script
    --- code from Safari.
    --- Check out:
    --- http://www.apple.com/applescript/bluetooth/
    --- for more scripts from Apple.

    return {10, 5, "System Volume"}

    on sliderWasChanged(passed_value)
    set percent_amounts to ¬
    {0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100}
    set the increment_amounts to ¬
    {0, 0.05, 0.1, 0.2, 0.4, 0.7, 1.2, 1.9, 3, 4.6, 7}
    set the percentage_strings to ¬
    {"0%", "10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", "90%", "100%"}
    repeat with i from 1 to the count of the percent_amounts
    if the passed_value is (item i of the percent_amounts) then
    set volume (item i of the increment_amounts)
    beep
    return ("System Volume is " & (item i of the percentage_strings))
    end if
    end repeat
    end sliderWasChanged


    in case you were wondering how it works...

    moderator: you may delete this thread... if i can't
     
  3. idkew thread starter macrumors 68020

    idkew

    Joined:
    Sep 26, 2001
    Location:
    where the concrete to dirt ratio is better
    #3
    yeah- apple bases its volume on a 0-7 scale, not 0-10 or 0-100 as i had guessed..... and it is not a stright scale... grows kinda exponentially....

    weird.
     

Share This Page