Geektool GeekTool's Applescript Capabilities

Discussion in 'UI Customization' started by BenJuan26, Sep 19, 2013.

  1. BenJuan26 macrumors newbie

    Joined:
    Sep 17, 2011
    Location:
    Canada
    #1
    I have been diving into some deeper GeekTool usage, and have found some great AppleScripts that tell GeekTool to do a variety of things. I was wondering if anyone knows of a list of all the AppleScript commands GeekTool will recognize. I have searched for quite some time and have not found such a list.
     
  2. tag macrumors 6502a

    tag

    Joined:
    Apr 29, 2005
    Location:
    PA, US
    #2
    The reason you haven't found such a list is because one probably doesn't exist.

    I mean basically any ApplesScript can be run by GeekTool, as GeekTool just executes an AppleScript via command line program 'osascript'. So GeekTool has the capability of running any AppleScript. You could even run an AppleScript through GeekTool that creates a popup window every time it refreshes (via display dialog / display alert, etc...) if you really wanted as far as I know.

    GeekTool is essentially a middleman for displaying output from scripts/code at preset intervals of your choosing. If an AppleScript or other code can be executed via commandline, it can be run through GeekTool.
     
  3. BenJuan26 thread starter macrumors newbie

    Joined:
    Sep 17, 2011
    Location:
    Canada
    #3
    I'm aware that GeekTool can run any AppleScript, but AppleScript can also execute commands to GeekTool using 'tell application "GeekTool Helper" ...'. For example I've managed to do this:
    Code:
    tell application "GeekTool Helper"
    	-- disable any visible groups
    	set numOfGroups to number of groups
    	set i to 1
    	repeat numOfGroups times
    		set visible of group i to false
    		set i to i + 1
    	end repeat
    	
    	-- enable the group that was selected
    	set visible of group choiceAsString to true
    	
    end tell
    It's worked fine so far, but I had to guess which commands GeekTool would accept. I'm interested in what other things I can ask GeekTool to do from AppleScript.
     
  4. tag macrumors 6502a

    tag

    Joined:
    Apr 29, 2005
    Location:
    PA, US
    #4
    Ah sorry I misunderstood what you were asking.

    You can use the "AppleScript Editor" app to view command dictionaries for apps. Simply open AppleScript Editor, click "File", click "Open Dictionary...", then choose "GeekTool Helper" from the list, and you should be shown documented classes and commands for that app. Though I will say this is not always complete, but it's the only thing I've personally come across other than developer documentation, which after a quick search, I didn't come across any online for GeekTool.
     
  5. BenJuan26 thread starter macrumors newbie

    Joined:
    Sep 17, 2011
    Location:
    Canada
    #5
    That's exactly what I was looking for, thanks!
     

Share This Page