FL!P



FL!P Weblog



Search this weblog for:


Day Link Icon Monday, May 31, 2010
Tips and Tricks for Keyboard Maestro Software (posted at 3:26 PM by Philippe Martin)

Keyboard Maestro is a fantastic macro program that I've been happily using (and beta testing) for years and for tons of different things.

I'm so used to using it that it has become almost completely intuitive to me, but reading and answering questions on KM's mailing list, I realized that some things which are obvious to me aren't so to everybody.

So I decided to share some of my experience with KM and compiled this list of tips and tricks.



Permanent Link | Comments: 0 | View Comments | Add Comment



Day Link Icon Thursday, July 2, 2009
Display system version and build number in GeekTool Software (posted at 5:16 PM by Philippe Martin)

If you're a developer or a tester who uses to switch between various versions of Mac OS for testing purposes, you might find handy to get GeekTool to display the system version and build number. Here's how I do it:

echo `/usr/libexec/PlistBuddy -c "Print :ProductUserVisibleVersion" /System/Library/CoreServices/SystemVersion.plist` (`/usr/libexec/PlistBuddy -c "Print :ProductBuildVersion" /System/Library/CoreServices/SystemVersion.plist`)

The result is something like this:

10.5.7 (9J61)

Permanent Link | Comments: 0 | View Comments | Add Comment




Day Link Icon Wednesday, June 17, 2009
AppleScript Tips for GeekTool 3 Software (posted at 7:38 PM by Philippe Martin)

I love GeekTool and I love even more GeekTool 3 that's currently in development.

However it's not feature complete yet and some things you could do with GeekTool 2 (like switching between groups from a menu) aren't implemented in 3 yet. But GeekTool 3 is now scriptable, which allows to do things from the outside that you cannot do yet with GeekTool 3 alone, like displaying/hiding a given geeklet.

The following script shows how I do that:

property geekletId : "E25ED489-C623-481E-91F1-96A2A614A6BF"
property cmd : "uptime"
property theHeight : 20.0
property theWidth :500.0
tell application "GeekTool"
    tell geeklet id geekletId
        if command is "" then
            set command to cmd
            set refresh time to 10
            set height to theHeight
            set width to theWidth
        else
            set command to ""
            set refresh time to 0
            set height to 0.0
            set width to 0.0
        end if
        refresh
    end tell
end tell

Note that changing the height and width of the geeklet is useful only if you gave it a background colour. Also, the command can be set to anything you can enter in GeekTool's command field itself, but if that command contains any double quotes you'll have to escape each of them with a backslash.

The only tricky bit here (unless you're using the fantastic Script Debugger) is to get the geeklet's Id. But here's a way to get a list of every geeklet's id in relation with its command:

tell application "GeekTool"
    set s to ""
    set lsGeeklets to every geeklet
    repeat with aGeeklet in lsGeeklets
        tell aGeeklet as specifier
            set s to s & id & tab & (command as string) & return
        end tell
    end repeat
end tell
tell application "BBEdit"
    activate
    make new text document in front
    set text of window 1 to s
end tell

And finally you can refresh all the geeklets at once with this simple oneliner:

tell application "GeekTools" to refresh all

These scripts can be called from Apple's AppleScript Menu, Keyboard Maestro, and so on.



Permanent Link | Comments: 1 | View Comments | Add Comment











Site Managed with Conversant