home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Add-Ons / AppleScript / Switch Keyboard / Switch Keyboard.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-05  |  1.2 KB  |  52 lines  |  [TEXT/CWIE]

  1. ////////////////////////////////////////////////////////////////////
  2. //
  3. //      kbdswitch
  4. //      an OSAX
  5. //        (1 line added to a shell made by butchering one of
  6. //      D.Olson's excellent examples)
  7. //
  8. //         John Blackburne, johnb@tempest.net.hk, 14 August 1995
  9. //        
  10. //
  11. //////////////////////////////////////////////////////////////////
  12.  
  13. // Our includes
  14. // #include <Memory.h>
  15. // #include <Fonts.h>
  16. // #include <OSEvents.h>
  17. // #include <limits.h> 
  18. // #include <Menus.h>
  19. // #include <Processes.h>
  20. // #include <String.h>
  21. // #include <Resources.h>
  22. // #include <Packages.h>
  23. // #include <AppleEvents.h>
  24. // #include <Errors.h>
  25. // #include <GestaltEqu.h>
  26. // #include <Files.h>
  27. // #include <Script.h>
  28.  
  29. ////////////////////////////////////////////////////////////////////
  30. //
  31. //     main()
  32. //    The entry to our Scripting Addition.
  33. //    Remember to declare it pascal!!
  34. //
  35. //////////////////////////////////////////////////////////////////
  36.  
  37. pascal OSErr main(    AppleEvent *theEvent, 
  38.                     AppleEvent *theReply, 
  39.                     long theRefCon)
  40. {    
  41.     OSErr        theErr = noErr;
  42.         
  43.       /*
  44.           Switch the keyboard
  45.        */
  46.        
  47.      KeyScript(smKeyNextKybd);                                 
  48.     
  49.     
  50.     return theErr;    // And return our error.
  51. }
  52.