TMTOOLS Help
version 0.905 by Hans-Jörg Bibiko
allBookmarksallBundleItemsallBundlesallCommandsallEnvironmentVariablesallGrammarsallPreferencesallSnippetsallSymbolsallTemplatesantiAliasEnabledautoIndentbundlePathsForUUID '{uuid="XXX"}'completionListFor '{prefix="XXX"}'contentOfWindow '{pathContains="XXX"}'currentCharactercurrentFontNamecurrentFontSizecurrentGrammarUUIDcurrentGrammarcurrentSpellCheckerLanguagecurrentStyleSheetcurrentSymbolcurrentWordCharscurrentWorddefaultBundlefoldingsEnabledfreehandModefrontMostDocumenthardWraphasSelectionindentedPasteisContinuousSpellCheckingEnabledisDocumentEditedlineHeadlineTailmainScreenSizeopenDocumentFilesopenProjectFilesoverwriteModepositionUnderCaretselectionXMLshowBookmarksInGuttershowLineNumbersInGuttershowSoftWrapInGuttersmartTypingsoftTabssoftWrapstandardUserDefaults '{key="XXX"}'suggestedExtensionForDocumenttextStringtextXMLuuidFor '{name="XXX"; kind="YYY";}'windowOriginAndSizewordHeadwordTailantiAliasEnabled '{to=X;}'autoIndent '{to=X;}'bookmarks '{to=(X,Y,...);}'caretTo '{line=X;index=Y;}'continuousSpellCheckingEnabled '{to=X;}'expandSnippetsOnTab '{to=X;}'foldingsEnabled '{to=X;}'fontName '{to="XXX";}'fontSize '{to=X;}'freehandedEdit '{to=X;}'frontMostDocument '{to="XXX";}'grammar '{to="XXX";}'indentedPaste '{to=X;}'lineNumbering '{to=X;}'overwriteMode '{to=X;}'selectionTo '{line=X;column=Y;length=Z}'selectionToCurrentScopeshowBookmarksInGutter '{to=X;}'showInvisibles '{to=X;}'showSoftWrapInGutter '{to=X;}'smartTyping '{to=X;}'softTab '{to=X;}'spellCheckerLanguage '{to=XXX;}'tabWidth '{to=X;}'windowOrigin '{x=X;y=Y;}'windowSize '{width=X;height=Y;}'wordChars '{to="XXX";}'snippet '{value="XXX";}'text '{value="XXX";}'bundleItem '{uuid="XXX";}'command '{name="XXX";}'command PLISTmacro '{name="XXX";}'macro PLISTsnippet '{name="XXX";}'template '{name="XXX";}'nextBookmarknextSnippetFieldprevBookmarkprevSnippetFieldalertSheetbundleEditorbundleMenucontextMenuopenPanelprintPanelprojectDrawer '{onEdge=X;}'saveAsPanelwebPreviewallAuxiliaryWindowsallFloatingDocumentWindowsallWindowsallBundlesallBookmarkscolumnLeftcolumnRightlineDownlineUpwindowToCaretpathusingDictionaryusingDocumentcenterWindowcheckUUID '{uuid="XXX";}'miniaturizeAllWindowsonKeyDownAfterDelay '{delay=T; shell="XXX"; }' or PLISTopenFileInNewWindowopenFileWithFinderredorevealFileInFindersaveCurrentDocumentsaveWithFilenameAndReopen '{name="XXX";}'undozoomWindowmeThe TMTOOLS plug-in is a conglomeration of shell commands which provide the user with advanced functionality to interact with TextMate.
It is based on code fragments of tm_dialog 1.x and 2.x. Furthermore I was inspired by: Allan Odgaard, Joachim Mårtensson, Chris Thomas, Ciarán Walsh, and Håkan Waara.
TMTOOLS plug-in calls undocumented TextMate functions without an appropriate API.
To use the TMTOOLS plug-in write a shell command:
"$TMTOOLS" verb command {options}
... | "$TMTOOLS" verb command -
For help type the following into an empty line of a TextMate document and press CTRL+R
"$TMTOOLS" help me
verb := [ get | set | move | insert | call | goto | show | close | reload | delete | scroll | complete | use | do | help ]
The plug-in sets an environment variable “$TMTOOLS” automatically. “TMTOOLS” only interacts with TextMate if you invoke it from a document, meaning this plug-in doesn’t work with the Bundle Editor, Web Preview, etc. in order to avoid unstableness.
options must be written as ‘Property List’. If the property list will be piped to TMTOOLS one has to write a - (a hyphen) to tell TMTOOLS to read the options on STDIN.
Each value given in the Property List will be evaluated as string and converted internally if needed.
In order to get TMTOOLS’ version type
"$TMTOOLS" -v
Bash Example
It checks whether TMTOOLS is installed and if the current version is greater or equal 0906. If not it will download the plug-in.
if [ -z "$TMTOOLS" ]; then
open "http://email.eva.mpg.de/~bibiko/downloads/textmate/TMTools.tmplugin.zip"
exit_discard
fi
VERSION=$("$TMTOOLS" -v)
if [ $VERSION -lt 906 ]; then
open "http://email.eva.mpg.de/~bibiko/downloads/textmate/TMTools.tmplugin.zip"
exit_discard
fi
In general get asks Textmate for something.
allBookmarksline = line number and name = line content."no bookmarks". "$TMTOOLS" get allBookmarks
echo -n "{format=plain;}" | "$TMTOOLS" get allBookmarks -
allBundleItemsname and UUID."$TMTOOLS" get allBundleItems
allBundlesname and UUID."$TMTOOLS" get allBundles
allCommandsname and UUID."$TMTOOLS" get allCommands
allEnvironmentVariableskey = name and string = value.variables must be an array. "$TMTOOLS" get allEnvironmentVariables '{format=plain;}'
"$TMTOOLS" get allEnvironmentVariables '{variables=(TM_LINE_NUMBER, TM_SELECTED_TEXT, TM_SCOPE);}'
allGrammarsname and UUID."$TMTOOLS" get allGrammars
allPreferencesname and UUID."$TMTOOLS" get allPreferences
allSnippetsname and UUID."$TMTOOLS" get allSnippets
allSymbolsname and UUID."$TMTOOLS" get allSymbols
allTemplatesname and UUID."$TMTOOLS" get allTemplates
antiAliasEnabledantiAliasEnabled "$TMTOOLS" get antiAliasEnabled
autoIndentautoIndent "$TMTOOLS" get autoIndent
bundlePathsForUUID '{uuid="XXX"}' "$TMTOOLS" get bundlePathsForUUID '{uuid="0D42D5EE-5800-40A6-AD0E-29C3F56FAF16";}'
completionListFor '{prefix="XXX"}'prefix = XXX as property list based on the current WordChars "$TMTOOLS" get completionListFor '{prefix="Text"}'
echo -n "prefix=$TM_CURRENT_WORD;format=plain;" | "$TMTOOLS" get completionListFor -
contentOfWindow '{pathContains="XXX"}' "$TMTOOLS" get contentOfWindow '{pathContains="MyDocument"}'
currentCharacter"$TMTOOLS" get currentCharacter
currentFontName"$TMTOOLS" get currentFontName
currentFontSize"$TMTOOLS" get currentFontSize
currentGrammarUUID"$TMTOOLS" get currentGrammarUUID
currentGrammar"$TMTOOLS" get currentGrammar
currentSpellCheckerLanguage"$TMTOOLS" get currentSpellCheckerLanguage
currentStyleSheet"$TMTOOLS" get currentStyleSheet
currentSymbol"$TMTOOLS" get currentSymbol
currentWordChars"$TMTOOLS" get currentWordChars
currentWordTM_CURRENT_WORD
delimiter is specified it recognizes a word if it is enclosed by SPACESdelimiter you can specify the word boundariesonly = head it will output only these characters which are before the caret of the current wordonly = tail it will output only these characters which are after the caret of the current word "$TMTOOLS" get currentWord '{delimiter=" ()";}'
"$TMTOOLS" get currentWord '{only=head;}'
"$TMTOOLS" get currentWord '{only=tail;delimiter=" ():.";}'
defaultBundlename and UUID."$TMTOOLS" get defaultBundle
foldingsEnabledfoldingsEnabled "$TMTOOLS" get foldingsEnabled
freehandModefreehandMode "$TMTOOLS" get freehandMode
frontMostDocument"$TMTOOLS" get frontMostDocument
hardWraphardWrap "$TMTOOLS" get hardWrap
hasSelection"$TMTOOLS" get hasSelection
indentedPasteindentedPaste "$TMTOOLS" get indentedPaste
isContinuousSpellCheckingEnabledisContinuousSpellCheckingEnabled "$TMTOOLS" get isContinuousSpellCheckingEnabled
isDocumentEditedisDocumentEdited "$TMTOOLS" get isDocumentEdited
lineHead"$TMTOOLS" get lineHead
lineTail"$TMTOOLS" get lineTail
mainScreenSize"$TMTOOLS" get mainScreenSize
openDocumentFiles "$TMTOOLS" get openDocumentFiles
"$TMTOOLS" get openDocumentFiles '{format=plain;shellEscape;}'
eval mate `"$TMTOOLS" get openDocumentFiles '{format=mate;}'` untitled
L=$("$TMTOOLS" get openDocumentFiles '{format=mate;}')
"$TMTOOLS" do closeAllFloatingDocumentWindows
eval mate "$L" untitled
FRONTMOSTFILE=$("$TMTOOLS" get frontMostDocument '{urlEscape;}')
eval mate `"$TMTOOLS" get openDocumentFiles '{format=mate;}'` untitled
open "txmt://open/?url=file://$FRONTMOSTFILE"
"$TMTOOLS" close allFloatingDocumentWindows
open "txmt://open/?url=file://$FRONTMOSTFILE"
openProjectFiles "$TMTOOLS" get openProjectFiles
"$TMTOOLS" get openProjectFiles '{format=plain;urlEscape;}'
overwriteModeoverwriteMode "$TMTOOLS" get overwriteMode
positionUnderCaret"$TMTOOLS" get positionUnderCaret
selectionXML"$TMTOOLS" get selectionXML
showBookmarksInGuttershowBookmarksInGutter "$TMTOOLS" get showBookmarksInGutter
showLineNumbersInGuttershowLineNumbersInGutter "$TMTOOLS" get showLineNumbersInGutter
showSoftWrapInGuttershowSoftWrapInGutter "$TMTOOLS" get showSoftWrapInGutter
smartTypingsmartTyping meaning the auto-pair status"$TMTOOLS" get smartTyping
softTabssoftTabs "$TMTOOLS" get softTabs
softWrapsoftWrap "$TMTOOLS" get softWrap
standardUserDefaults '{key="XXX"}'standardUserDefaults "$TMTOOLS" get standardUserDefaults '{key=OakTextViewNormalFontName;}'
suggestedExtensionForDocument"$TMTOOLS" get suggestedExtensionForDocument
textString"$TMTOOLS" get textString
textXML"$TMTOOLS" get textXML
uuidFor '{name="XXX"; kind="YYY";}'bundle | command | snippet | language | template | preference | macro "$TMTOOLS" get uuidFor '{name="Lorem ipsum"; kind="snippet";}'
"$TMTOOLS" get uuidFor '{name="defaultBundle"; kind="bundle";}'
windowOriginAndSize"$TMTOOLS" get windowOriginAndSize
wordHeadTM_CURRENT_WORD before the caret’s position"$TMTOOLS" get wordHead
wordTailTM_CURRENT_WORD after the caret’s position"$TMTOOLS" get wordTail
In general set sets something in the current document.
antiAliasEnabled '{to=X;}'yes or noantiAliasEnabled to yes or no "$TMTOOLS" set antiAliasEnabled '{to=no;}'
autoIndent '{to=X;}'yes or noautoIndent to yes or no "$TMTOOLS" set autoIndent '{to=no;}'
bookmarks '{to=(X,Y,...);}'to must be an array of positive integers "$TMTOOLS" set bookmarks '{to=(5,10,15,20,25);}'
caretTo '{line=X;index=Y;}'See also [move caretBy]
Examples
"$TMTOOLS" set caretTo '{line=2;index=4;}'
"$TMTOOLS" set caretTo '{index=end;}'
"$TMTOOLS" set caretTo '{line=2;}'
"$TMTOOLS" set caretTo '{index=4;}'
continuousSpellCheckingEnabled '{to=X;}'yes or nocontinuousSpellCheckingEnabled to yes or no "$TMTOOLS" set continuousSpellCheckingEnabled '{to=no;}'
expandSnippetsOnTab '{to=X;}'yes or noexpandSnippetsOnTab to yes or no "$TMTOOLS" set expandSnippetsOnTab '{to=no;}'
foldingsEnabled '{to=X;}'yes or nofoldingsEnabled to yes or no "$TMTOOLS" set foldingsEnabled '{to=yes;}'
fontName '{to="XXX";}' "$TMTOOLS" set fontName '{to="Monaco";}'
fontSize '{to=X;}' "$TMTOOLS" set fontSize '{to=14;}'
freehandedEdit '{to=X;}'yes or nofreehandedEdit to yes or no "$TMTOOLS" set freehandedEdit '{to=yes;}'
frontMostDocument '{to="XXX";}'yes.get openProjectFile 'format=plain;urlEscape;' and TextMate’s URL scheme open "txmt://open/?url=file://$FILENAME" "$TMTOOLS" set frontMostDocument '{to="/Users/TextMate/index.html";}'
grammar '{to="XXX";}'grammar, used for syntax highlighting, to XXX "$TMTOOLS" set grammar '{to="Plain Text";}'
indentedPaste '{to=X;}'yes or noindentedPaste to yes or no "$TMTOOLS" set indentedPaste '{to=no;}'
lineNumbering '{to=X;}'yes or noyes or no "$TMTOOLS" set lineNumbering '{to=no;}'
overwriteMode '{to=X;}'yes or nooverwriteMode to yes or no "$TMTOOLS" set overwriteMode '{to=yes;}'
selectionTo '{line=X;column=Y;length=Z}'line X and column Y from the caret’s positionLine and column could also be negativelength is set it will select Z characters relative from the caret (could also be negative)length is set line and column will be ignoredline is not set the current line number is used "$TMTOOLS" set selectionTo '{line=2;column=3;}'
"$TMTOOLS" set selectionTo '{length=-2;}'
selectionToCurrentScope"$TMTOOLS" set selectionToCurrentScope
showBookmarksInGutter '{to=X;}'yes or noshowBookmarksInGutter to yes or no "$TMTOOLS" set showBookmarksInGutter '{to=yes;}'
showInvisibles '{to=X;}'yes or noshowInvisibles to yes or no "$TMTOOLS" set showInvisibles '{to=yes;}'
showSoftWrapInGutter '{to=X;}'yes or noshowSoftWrapInGutter to yes or no "$TMTOOLS" set showSoftWrapInGutter '{to=yes;}'
smartTyping '{to=X;}'yes or nosmartTyping — the auto-pair function — temporally for the current document to yes or no "$TMTOOLS" set smartTyping '{to=no;}'
softTab '{to=X;}'yes or nosoftTab to yes or no "$TMTOOLS" set softTab '{to=yes;}'
spellCheckerLanguage '{to=XXX;}' "$TMTOOLS" set spellCheckerLanguage '{to=en_GB;}'
tabWidth '{to=X;}' "$TMTOOLS" set tabWidth '{to=8;}'
windowOrigin '{x=X;y=Y;}' "$TMTOOLS" set windowOrigin '{x=100;y=150;}'
windowSize '{width=X;height=Y;}' "$TMTOOLS" set windowSize '{width=100;height=200;}'
wordChars '{to="XXX";}'wordChars used for TM_CURRENT_WORD to XXX "$TMTOOLS" set wordChars '{to="_$";}'
In general move moves something in the current document.
move caretBy '{line=X;index=Y;}' "$TMTOOLS" move caretBy '{index=-2;}'
move caretToCenter"$TMTOOLS" move caretToCenter
move selectionBy '{line=X;column=Y;}' "$TMTOOLS" move selectionBy '{line=-2;column=-3;}'
In general insert inserts something in the current document.
snippet '{value="XXX";}' "$TMTOOLS" insert snippet '{value="\${1:Hello} - \${2:World}\${3:}";}'
text '{value="XXX";}' "$TMTOOLS" insert text '{value="Hello World";}'
In general call executes an item which is stored as bundle item.
bundleItem '{uuid="XXX";}' "$TMTOOLS" call bundleItem '{uuid="DA0A4E77-5F16-11D9-B9C3-000D93589AF6";}'
command '{name="XXX";}' "$TMTOOLS" call command '{name="Add Line Numbers to Document / Selection";}'
command PLIST "$TMTOOLS" call command '
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>
A=$(cat)
echo -e "$A"
echo -en "Hello World"
</string>
<key>input</key>
<string>selection</string>
<key>fallbackInput</key>
<string>word</string>
<key>output</key>
<string>showAsTooltip</string>
</dict>
'
macro '{name="XXX";}' "$TMTOOLS" call macro '{name="Delete Line";}'
macro PLIST "$TMTOOLS" call macro '{
commands = (
{command = "moveWordRight:"; },
{command = "moveWordLeftAndModifySelection:"; },
{command = "moveWordLeftAndModifySelection:"; },
{command = "moveWordLeftAndModifySelection:"; }
);
}'
"$TMTOOLS" call macro '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/#PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>commands</key>
<array>
<dict>
<key>argument</key>
<dict>
<key>action</key>
<string>replaceAll</string>
<key>findInProjectIgnoreCase</key>
<false/>
<key>findString</key>
<string>Textmate is good</string>
<key>ignoreCase</key>
<true/>
<key>replaceAllScope</key>
<string>document</string>
<key>replaceString</key>
<string>TextMate is extraordinary</string>
<key>wrapAround</key>
<true/>
</dict>
<key>command</key>
<string>findWithOptions:</string>
</dict>
</array>
</dict>
</plist>
'
snippet '{name="XXX";}' "$TMTOOLS" call snippet '{name="Lorem ipsum";}'
template '{name="XXX";}' "$TMTOOLS" call template '{name="From Clipboard";}'
In general goto goes to an item.
nextBookmark"$TMTOOLS" goto nextBookmark
nextSnippetField"$TMTOOLS" goto nextSnippetField
prevBookmark"$TMTOOLS" goto prevBookmark
prevSnippetField"$TMTOOLS" goto prevSnippetField
In general show opens a panel or window.
alertSheetinformational, critical, or warning "$TMTOOLS" show alertSheet '{informativeText="This is only a info";
messageTitle="This is a message";buttonTitles=(OK,Cancel);alertStyle=critical;}'
bundleEditor"$TMTOOLS" show bundleEditor
bundleMenu"$TMTOOLS" show bundleMenu
contextMenu"$TMTOOLS" show contextMenu
openPanel"$TMTOOLS" show webPreview
printPanel"$TMTOOLS" show printPanel
projectDrawer '{onEdge=X;}' "$TMTOOLS" show projectDrawer '{onEdge=0;}'
saveAsPanel"$TMTOOLS" show saveAsPanel
webPreview"$TMTOOLS" show webPreview
In general close closes windows.
allAuxiliaryWindows "$TMTOOLS" close allAuxiliaryWindows
"$TMTOOLS" close allAuxiliaryWindows '{except=(OakFindPanel, OakBundleEditorWindow);}'
allFloatingDocumentWindows"$TMTOOLS" close allFloatingDocumentWindows
allWindows"$TMTOOLS" close allWindows
In general reload reloads something.
allBundles"$TMTOOLS" reload allBundles
In general delete deletes something.
allBookmarks"$TMTOOLS" delete allBookmarks
In general scroll scrolls the window content of the current document.
columnLeft"$TMTOOLS" scroll columnLeft
columnRight"$TMTOOLS" scroll columnRight
lineDown"$TMTOOLS" scroll lineDown
lineUp"$TMTOOLS" scroll lineUp
windowToCaret"$TMTOOLS" scroll windowToCaret
In general complete will show a pull-down menu of suggestions. While typing this list will be updated automatically. This code is mainly taken from Joachim Mårtensson. Changes are only done for the event handling. This pull-down menu will not interfere with tm_dialog.
pathTM_DIRECTORY resp. at root / if the document is not yet saved.TM_BUNDLE_SUPPORT or TM_SUPPORT_PATH as a valid path before the caret it will start at this position.. or .., and ~ indicating the user’s $HOME directory.\."$TMTOOLS" complete path
usingDictionarylang accordingly:
en_US, en_GB, en_AU, en_CA, de, fr, fr_CA, es, it, nl, sv, nb, da, fi, pt are attestedzh-Hans, zh-Hant, ko, jp are not yet attestedno.no. "$TMTOOLS" complete usingDictionary
"$TMTOOLS" complete usingDictionary '{lang="de_DE";}'
"$TMTOOLS" complete usingDictionary '{lang="da";showInternalListFirst=yes;}'
usingDocument"$TMTOOLS" complete usingDocument
In general use is an API to cocoa’s objects.
nsstring '{initWith="XXX"; toGet="YYY"}' "$TMTOOLS" use nsstring '{initWith="ö"; toGet="decomposedStringWithCanonicalMapping";}'
"$TMTOOLS" use nsstring '{initWith="รถ"; toGet="decomposedStringWithCanonicalMapping";}'
"$TMTOOLS" use nsstring '{initWith="hello"; toGet="hasPrefix:"; with="he"; }'
"$TMTOOLS" use nsstring '{initWith="hello"; toGet="length"; }'
"$TMTOOLS" use nsstring '{initWith="hello"; toGet="rangeOfString:"; with="el"; }'
"$TMTOOLS" use nsstring '{initWith="hello"; toGet="smallestEncoding"; }'
"$TMTOOLS" use nsstring '{initWith="A:B:C"; toGet="componentsSeparatedByString:"; with=":"; }'
"$TMTOOLS" use nsstring '{initWith="hello"; toGet="compare:"; with="hel"; }'
"$TMTOOLS" use nsstring '{initWith="たてもの"; toGet="characterAtIndex:"; with="2"; }'
"$TMTOOLS" use nsstring '{initWith="たてもの"; toGet="canBeConvertedToEncoding:"; with="8"; }'
"$TMTOOLS" use nsstring '{initWith="/Users/TextMate"; toGet="lastPathComponent";}'
"$TMTOOLS" use nsstring '{initWith="たてもの"; toGet="stringByAddingPercentEscapesUsingEncoding:"; with="4"; }'
"$TMTOOLS" use nsstring '{initWith="%E3%81%9F%E3%81%A6%E3%82%82%E3%81%AE";
toGet="stringByReplacingPercentEscapesUsingEncoding:"; with="4"; }'
"$TMTOOLS" use nsstring '{initWith="{z=({a='b';});}"; toGet="propertyList"; }'
"$TMTOOLS" use nsstring '{initWith="юри"; toGet="caseInsensitiveCompare:"; with="Юри"; }'
In general do executes something or implements an event handler.
centerWindow"$TMTOOLS" do centerWindow
checkUUID '{uuid="XXX";}'1 if XXX is not used by TextMate.0 if XXX is used by TextMate.uuidgen. "$TMTOOLS" do checkUUID '{uuid="67CBC425-6A5B-4621-97A1-147C8CEC221A";}'
miniaturizeAllWindows"$TMTOOLS" do miniaturizeAllWindows
onKeyDownAfterDelay '{delay=T; shell="XXX"; }' or PLISTstopkey is the integer value of a key event (e.g. 53 = ESC) which interrupts that event handler loop.stopkey is passed the shell command or the command passed via PLIST will be executed only once. After that the keyDown loop handler will interrupt.stopkey is passed and the event handler loop will be interrupted an acoustic signal (Plop) will be played.yes.no.no. "$TMTOOLS" do onKeyDownAfterDelay "{delay=2;
shell='\"$TMTOOLS\" call command \'{name=\"ShowCurrentScopeToolTip\";}\''; stopkey=53; }"
"$TMTOOLS" do onKeyDownAfterDelay "{delay="0.5";
shell='\"$TMTOOLS\" complete usingDictionary \"{lang=de_DE;}\"'; stopkey=53; }"
"$TMTOOLS" do onKeyDownAfterDelay "{delay="1.5"; repeat=yes; startAtCall=no;
shell='\"$TMTOOLS\" complete usingDocument'; stopkey=53; }"
"$TMTOOLS" do onKeyDownAfterDelay "{delay="5"; repeat=no; startAtCall=no;
shell='\"$TMTOOLS\" get textString > /tmp/\"$TM_FILENAME\".txmtbkp;say \"document was saved\"'; stopkey=53; }"
"$TMTOOLS" do onKeyDownAfterDelay '
<dict>
<key>delay</key>
<string>2</string>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>
A=$(cat)
echo -e "$A"
echo -en "Hello World"
</string>
<key>input</key>
<string>selection</string>
<key>fallbackInput</key>
<string>word</string>
<key>output</key>
<string>showAsTooltip</string>
</dict>
'
openFileInNewWindow"$TMTOOLS" do openFileInNewWindow
openFileWithFinder"$TMTOOLS" do openFileWithFinder
redoredo."$TMTOOLS" do redo
revealFileInFinder"$TMTOOLS" do revealFileInFinder
saveCurrentDocument "$TMTOOLS" do saveCurrentDocument '{avoidPanel;}'
avaoidPanel and react to the return value.saveWithFilenameAndReopen '{name="XXX";}' "$TMTOOLS" do saveWithFilenameAndReopen '{name="/Users/TextMate/test.txt";overwriteMode;}'
FILENAME="$TM_SELECTED_TEXT"
EXT=$("$TMTOOLS" get suggestedExtensionForDocument)
filename="$(CocoaDialog filesave --with-directory `dirname "$TM_FILEPATH"` --with-file "$FILENAME.$EXT" )"
if [ -n "$filename" ]; then
echo "{name=\""$filename"\";overwriteMode;}" |"$TMTOOLS" do saveWithFilenameAndReopen -
fi
undoundo."$TMTOOLS" do undo
zoomWindow"$TMTOOLS" do zoomWindow
me"$TMTOOLS" help me
do onKeyDownAfterDelay only works on a TM text document; not on auxiliary panels etc.do onKeyDownAfterDelay an option passEvent yes or nodo onKeyDownAfterDelay the possibility not only to execute a shell command but also a command specified by a PLISTdo onKeyDownAfterDelay if no stopkey is given the shell script or the command will only execute once; after that the loop handler does not existget currentCharactercall command the possibility not only to call a saved tmCommand via its name but also to pass a plist containing command optionsdo closeAllWindowsget allEnvironmentVariables an option variables to output only these valuesclose allAuxiliaryWindows close allFloatingDocumentWindowsdo closeAllWindows to close allWindowsget openDocumentFilesset/get frontMostDocumentget openProjectFiles the output option format=mate;get openProjectFiles output option escape is renamed to shellEscapedo openFileInNewWindowdo revealFileInFinderdo openFileWithFindershow alertSheetget contentOfWindowget/set smartTypingget allBundlesget uuidForget defaultBundleget allBundleItemsdo checkUUID get bundlePathsForUUID do saveWithFilenameAndReopenget suggestedExtensionForDocumentdo saveCurrentDocumentshow bundleMenuIf there are further suggestions or bugs don’t hesitate to mail me.
26 October 2007 - Hans-Jörg Bibiko bibiko@eva.mpg.de