Menu

AppleScript for Laptop users...

Joe
2008-11-04
2013-01-02
  • Joe

    Joe - 2008-11-04

    I wrote a couple of applescripts to swap, and unswap the alt-command/alt-windows keys. I did this because I use a laptop and find myself switching a lot. I've submitted them to the project (GPL). I don't know if they will be included (haven't really given him time). If anyone wants these in the immediate term, they can be downloaded from
    http://www.cs.wright.edu/~jslater/Archive.zip

    They are fully undocumented. I saved them as Apps for my use (no launch screen, run only) and launch them quickly through spotlight. This points to the actual scripts. You'll have to make apps, or whatever you want of them.

    All they do is the swap. I think you can putz around inside and see how to do the rest.

    They WILL break if the GUI changes in the future.

    I'm sure they can be written better.

     
    • Dave Bates

      Dave Bates - 2008-11-04

      Thanks Joseph.  I do this all the time too.  I wish that double command could do it automatically whenever I plug in my external windows keyboard, but this is the next best thing.

       
      • Joe

        Joe - 2008-11-04

        I wish you had posted your code. I spent 2 hours figuring out that I had to use "list 1" to get to that checkbox, because I still really can't claim to know applescript. I felt like a monkey in a math test.

        I'll be one could write a background process to detect the USB item being plugged in and call the script. I'm not sure I'd want to waste the cpu time, though. Others may differ.

         
        • Michael Baltaks

          Michael Baltaks - 2008-11-04

          This might be of some help, and you can use the current DoubleCommand, you don't have to get the source code and build it as suggested in the first part of the article.

          http://schinckel.net/2008/02/13/doublecommand-and-multiple-keyboards/

          If anyone wants to write up the procedure they used to get this working, I'm happy to post this as a page on the website. I'm sorry this feature isn't in the PrefPane yet, but that's a lot more work than putting the feature into the kext, and it turns out I haven't had the time to go further.

          The basic principle is, if you find the keyboard id, you can assign a remapping to just that type of keyboard, meaning you can have a setting for your laptop keyboard, and then a different setting for your external keyboard.

           

Log in to post a comment.