[TxMt] Re: "Go to last edit" keyboard shortcut

Dru Kepple dru at summitprojects.com
Mon Oct 26 17:32:37 UTC 2009


On 25 Oct 2009, at 13:51, Alessandro Vernet wrote:
You're right, it looks like undo and redo can't be recorded in a macro. I tried editing the macro file by hand to add them, but no   luck.   Sorry, I don't have any other bright ideas.


Well, I was trying to utilize AppleScript.  I got a plain old script working:

tell application "System Events"
 tell process "TextMate"
  set frontmost to true
  keystroke "z" using {command down}
  keystroke "z" using {command down, shift down}
 end tell
end tell

Assuming you have "Enable Access for Assistive Devices" turned on in the Universal Access pref pane.

I got it working from the Terminal:

osascript -e 'tell application "System Events" to tell process "TextMate" to set frontmost to true'; osascript -e 'tell application "System Events" to tell process "TextMate" to keystroke "z" using {command down}'; osascript -e 'tell application "System Events" to tell process "TextMate" to keystroke "z" using {command down, shift down}'
(that's three commands all on one line...)

But putting that command into a TM Command doesn't seem to work.  I'm far from a scripting expert, Apple- or Bash, so maybe it could work with more love.  I've spent about as much time as I'm able to spend on such things, so hopefully someone else with more skills can take the idea?

Dru
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20091026/d176bed1/attachment.html>


More information about the textmate mailing list