Remove this ad
avatar

ericn

superstar

Posts: 284

Lead

Apr 19 10 6:05 PM

Tags : :

Posted by EricN on September 29, 2009 at 10:30pm


If the screencast in my last blog posting on my Modbook’s pen gesture setup gave you a chance to kick the tires and take a brief test drive, this posting provides you with a look under the hood. While everyone uses computers differently, a detailed look at someone else’s approach is often a good jumping off point for your own. In any event, this post will demonstrate the versatility and power of Quicksilver’s Abracadabra pen gesture system that we got a look at last time.


I’ll try to be simple and to the point showing the pen gesture, the associated Quicksilver action, and any special information you need to get it to work. I’m dividing the gestures into three groups: straight Quicksilver actions that work right out of the box, really, really simple AppleScript actions that instruct your computer to punch a key on your keyboard, and more complicated AppleScripts which I will run through in subsequent blog articles. If anything here seems confusing take another look at the screencast or leave some comments — I’ll be happy to respond. From the gestures and actions below, I hope you will be able to find and implement those that make the most sense for you.


Built-in Quicksilver Actions

Recall from the screencast that each gesture is associated with a Quicksilver action which itself is a “functional sentence”. In the table below, the QS object and the QS action are the two parts of that sentence and fill the first two parts of the Quicksilver command window. In the Plug-in/Comments column, I’ve noted some resources within Quicksilver that need to be made available in the form of a plug-in to be installed or a box to be checked in Quicksilver’s Catalog Pane.


Gesture

   QS Object: Activity Monitor.app ... QS Action: open application


   QS Object: Calculator.app ... QS Action: open application


   QS Object: Dashboard.app ... QS Action: open application


   QS Object:  iTunes.app ... QS Action: open application


   QS Object: Current Application ... QS Action: quit

Check: Proxy Objects in QS–>Catalog


   QS Object: QS Command Window ... QS Action: run (invoke QS)

Check: Internal Objects in QS–>Catalog


   QS Object: Eject.sh ... QS Action: run 

Extra Scripts plug-in


   QS Object: Sleep ... QS Action: run

Extra Scripts plug-in


   QS Object: Exposé All Windows ... QS Action: run

System Hot Key Commands plug-in


   QS Object: Exposé Desktop ... QS Action: run

System Hot Key Commands plug-in


   QS Object: http://modbookish.lafora.com ... QS Action: open URL

Safari plug-in


   QS Object: Browse Albums ... QS Action: Show Contents

iTunes plug-in


   QS Object: Next Song.scpt ... QS Action: run

iTunes plug-in


   QS Object: Previous Song.scpt ... QS Action: run

iTunes plug-in


   QS Object: Play-Pause.scpt ... QS Action: run

iTunes plug-in



Keystroke Applescript Actions

OS X has standard keyboard shortcuts for a wide range of common operations: cut (command-x), copy (command-c), paste (command-v), new document (command-n) etc. any of which can be made into a Quicksilver action using a simple one line AppleScript that duplicates the needed keystrokes. Such AppleScripts can make any keyboard shortcut accessible as an Abracadabra gesture. I also use this approach to make gestures for keystrokes that are unavailable from Apple’s Ink such as the forward delete or the function keys as well as keystrokes that Ink often gets wrong like period, comma, escape, return, quotation marks etc. This minimizes my need for the on-screen keyboard, which I find inconvenient and slow.


Any of the Applescripts shown below can be made into a Quicksilver action by first copying the script into the AppleScript Editor (found in /Applications/Utilities) and then saving the script to any folder that Quicksilver indexes. Many people put scripts in the ~/Library/Scripts folder (which works fine provide you make sure the box for Quicksilver —> Catalog —> Scripts —> Scripts(User) is checked). Then, either restart Quicksilver or rescan the catalog, and the script will be available from the Quicksilver text box. The action Quicksilver offers when the script’s name is entered should be:


QS object: #script name#.scpt 

QS action: run


This is the action you should associate with a gesture.



Unmodified KeyStrokes

An AppleScripts for keystrokes unaffected by a modifier key, that is where no shift, control, option, or command key is used, are the simplest. An Applescript that keystrokes a comma would look like:


tell application "System Events" to keystroke ","


With suitable replacement of the comma, this sort of script would work for:

   


Modified KeyStrokes

Adding a modifier key is not hard. For example, undo (command-z) is performed with


tell application "System Events" to keystroke "z" using command down


This kind of script would work for:

   

   

(For those unfamiliar, Make Bigger is typically command - = and Make Smaller is command - –).



Unquotable Keystrokes

Where the key’s character cannot easily be set in quotes, AppleScript allows you to use the key’s number. For example, the number for the delete key is 51. Hence, the AppleScript for the delete key is


tell application "System Events" to key code 51


Just like in the previous section, you can use modifier keys as in this script for double quotes:


tell application "System Events" to key code 39 using shift down


With this keyboard as a reference for key codes,




It is straightforward to build AppleScripts for any of the following:

     


In principle, return and escape could also be approached this way, but to afford the broadest use of these keystrokes — like trying to escape Front Row or some other full screen application — they should be dealt with a bit differently. However, as we’ve done gone through quite a lot already, let’s save that for a later forum article.


For more gestures and associated AppleScripts, checkout the forum thread: AppleScripts for Abracadabra Gestures in the "Tips, Tricks and Scripts" section.


EricN


Update: Dec. 31, 2009. After assisting someone in setting up Quicksilver with Abracadabra, I realize that I've failed to mention something important. In order to use AppleScripts that involve GUI scripting (as most of my AppleScript do), one must enable access for assistive devices. Simply open System Preferences and click on the Universal Access preference pane. Then, make sure the box for "Enable access for assistive devices" at the bottom is checked.

Quote    Reply   
Remove this ad
Remove this ad
avatar

ericn

superstar

Posts: 284

#1 [url]

Apr 19 10 7:49 PM

Original Reply by C J Adams on February 15, 2010

but this Just puts it over the top

http://voodoopad.com/flygesture/

 Reply to This

Comment by EricN on February 16, 2010 at 7:15am


Hey, thanks for the comments.


I did find them a bit cryptic though. If they were intended to suggest FlyGesture as an alternative pen gesture application program for the Modbook, then I've got to ask: Do you actually find FlyGesture usable on the Modbook? tf so, I'd be curious to hear how.


Before I figured out Abracadabra, I attempted to use FlyGesture and found it nearly useless for the Modbook.


Here's why:



"Press FI and Draw"?? If you have a keyboard to press f1, then there is no point in using pen gestures, the shortcut keys are all available on the keyboard and launching macros is way more efficient using Quicksilver, Launch bar, Butler or an assortment of other "Launcher" apps. A gesture program only has value when you have no keyboard, it is next to impossible to invoke FlyGesture without a keyboard since:


You can't use a virtual keyboard to invoke FlyGesture as it will position its gesture pad directly under the virtual keyboard making it unusable.


The mouse button approach to invoking FlyGesture does not appear to work on the Modbook.


Clicking on the FlyGesture dock icon does not invoke it.


The only way that I worked out to invoke FlyGesture without a keyboard was to use another gesture app (xGestures). Consequently, I'm surprised that anyone finds FlyGesture useful on a Modbook. How do you get it to work?

 Reply to This

Comment by C J Adams on February 16, 2010 at 7:28am


Oh yeah. easy.. i add one of the pen barrel buttons to trigger it. then add a bunch of apple scripts and actions to it. I find it acts a bit like abracadabra but without the go between of quicksilver. Most things there is a way to do just like QS. But i find it simpler and it just works.

CJ

Quote    Reply   
Add Reply

Quick Reply

bbcode help