AppleScript to automatically set volume to mute during shutdown

Discussion in 'Mac Programming' started by sultanoflondon, Apr 17, 2017.

  1. sultanoflondon macrumors regular

    Joined:
    Dec 3, 2013
    #1
    Hi all,

    When I run the following script, an error dialog box is displayed, which states " Syntax Error Expected end of line but found identifier." Can someone help me please?

    [start of AppleScript]
    tell application "Finder"

    during shutdown

    set curVolume to get volume settings

    if output muted of curVolume is false then

    set volume with output muted

    else

    set volume without output muted

    end if

    end tell
    [start of AppleScript]

    Thank you!
     
  2. Sciuriware macrumors regular

    Sciuriware

    Joined:
    Jan 4, 2014
    Location:
    Gelderland
    #2
    Why not unconditionally:

    osascript -e "set Volume 0"
    ;JOOP!
     
  3. sultanoflondon thread starter macrumors regular

    Joined:
    Dec 3, 2013
    #3

    Thank you for your reply!

    I am a beginner in AppleScript, could you please explain the code that you have written?
     
  4. Sciuriware macrumors regular

    Sciuriware

    Joined:
    Jan 4, 2014
    Location:
    Gelderland
    #4

Share This Page