Applescript problem

Discussion in 'macOS' started by joemolomo, Sep 20, 2010.

  1. joemolomo macrumors member

    May 20, 2008
    Hi, i work at a school and at the moment we don't have a mac server, so i'm using server tools on each local machine to set group policies for active directory logins. I want geektool to be enabled on each user when they login, i've got this to work so far by running this applescript I found online:

    tell application "System Preferences"
    delay 1
    tell application "System Events" to set visible of process "System Preferences" to false
    set current pane to pane "GeekTool"
    tell application "System Events"
    tell process "System Preferences"
    click checkbox "Enable" of window "GeekTool 3"
    end tell
    end tell
    delay 1
    end tell

    Now the only problem with this script is that when they log off and log back in again it deactivates the checkbox resulting in disabling geektool, so every other login disables geektool. I'm guessing I need to put an if statement in somewhere i'm just not that great at applescript, any help would be really appreciated.

  2. wrldwzrd89 macrumors G5


    Jun 6, 2003
    Solon, OH
    That's great - the next step is to add the script as a startup item so it runs at every login, which will do what you want. Found a link, here, that will help guide you through the setup process.
  3. joemolomo thread starter macrumors member

    May 20, 2008
    Hi yeah sorry should have explained, i've got the script running using workgroup manager so that anyone associated with the Active Directory group the script is run on login, but as I mentioned it disables it on the 2nd, 4th, 6th etc login and enables it on the 1st 3rd 5th etc login, because the code simple activates the checkbox no matter what state it is in.:confused:

Share This Page