On 08/10/2009, at 10:09 , jdx2172 wrote:
> My feature request is to run a line of terminal command when the user
> presses a keyboard shortcut. The application of that is like this...


Any macro program (like, I don't know, Keyboard Maestro, for  
example ;-) can do this.

Simply simulate Copy/Cut (Command-C/X) (better yet, both), then  
execute the shell script like pbpaste | sh | pbcopy, then Paste.

You may need to allow a delay between the Cut and the script  
execution.  And, of course, this is fraught with peril if you select  
the wrong chunk of text or the Cut fails for any reason (like no  
selection).

For safety, in Keyboard Maestro, I would be tempted to do:

Set Clipboard to Text: echo Nothing Copied
Simulated Command-C (handle readonly text)
Simulate Command-X (cut if possible)
Delay 0.2s
Execute script pbpaste | sh | pbcopy
Simulate Command-V

By setting the clipboard initially, you avoid a lot of potential  
disasters.

Enjoy,
    Peter.

-- 
      Clipboard Switching and Macros with Keyboard Maestro

Keyboard Maestro <http://www.keyboardmaestro.com/> Macros for your Mac
<http://www.stairways.com/>           <http://download.stairways.com/>




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.
-~----------~----~----~----~------~----~------~--~---

Reply via email to