1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Simple shell script in Automator, big problem for me

Discussion in 'Mac Programming' started by petertje123, May 27, 2009.

  1. macrumors newbie

    Hi, thanks for reading.

    This is the problem;
    For my Macbok AIr I need a script which alows me to excecute at startup these follwing lines: (I normaly have to add this manually in Terminal every time at startup)

    /Applications/smcFanControl.app/Contents/Resources/smc -k F0Mx -w $(python -c 'print hex(3500 << 2)[2:]')

    /Applications/smcFanControl.app/Contents/Resources/smc -k F0Mn -w $(python -c 'print hex(1500 << 2)[2:]')

    This is because the fan of the Air is spinning like hell. This lowers the speed to an acceptable noise level.

    Can someone explain me how to make this script. I understand that I can run an application in my User profile at startup.

    gr, from rainy Amsterdam
  2. macrumors 601


    In Automator, from the Library > Utilities section, drag a Run Shell Script object into your workflow, then paste that text into the text area inside it. If you want to run two commands like you have there, you'll probably have to either connect two of these objects, or paste both in the same window but replace the returns with a semicolon (see attached pic). Then save your script as an Application, and in System Preferences > Accounts > [your account] > Login Items, drag your script into the list. It should run whenever you log in.

    Attached Files:

  3. macrumors 68040


    Now just don't do anything so intensive that the fan should be spinning faster than your upper-bound, slowly frying your hardware.

    Also, why not hard-code the arguments there? You are going to, I would think, get the same value from python -c 'print hex(3500 << 2)[2:]' and python -c 'print hex(1500 << 2)[2:]' every time they run. Why not just use 36b0 and 1770 in your script?

  4. macrumors 601


    Yeah, I should have mentioned that playing around with your fan speeds seems very dangerous, I hope you know what you are doing.
  5. macrumors newbie

    Thanks for your help. It already spins at 6200 round when opening my Air. So for that reason I really needed a solution.

    What is the max temperature alowed for the Air CPU? 60/70/80degrees celcius??
  6. macrumors 68000

    Sounds like a hardware problem. Take it in to be fixed. Or, try resetting the firmware first.

Share This Page