Hope you find it useful!
|
|
|
I modified the script in this hint to open the contents of the frontmost Finder window in TextMate's browse view. Here's the source, and the (very basic) installation and usage instructions are commented in the source.
Hope you find it useful!
•
[8,400 views]
Hint Options
Open anything in TextMate via an AppleScript
I don't get it. What's the point of this script when you can just drag a file or directory from Finder and drop it onto the TextMate dock icon?
Open anything in TextMate via an AppleScript
Because you can't open some things as a plain text document (i.e., textmate project files... textmate theme files etc.)
An easy way to do the same thing is use terminal,
mate ./file.ext will open the source of the file and not the project/theme.---
Open anything in TextMate via an AppleScript
Here is a zsh shell script (or function) to cd to the directory displayed in the frontmost textmate window:
#!/bin/zsh -f
# cdt
DocPath="$(osascript -e 'tell app "TextMate" to return path of first document')"
DocDir="$(dirname "$DocPath")"
print "The frontmost TextMate file is $DocPath"
fdc () {
if [ -n "$1" ]
then
if [ "${1%%/*}" = "" ]
then
thePath="$1"
else
thePath="$(pwd)""/$1"
fi
else
thePath="$(pwd)"
fi
osascript /dev/null
print "Changing Finder display to $DocDir"
print "Current Working Directory remains $PWD"
elif [[ $1 = "-F" ]]
then
command cd $DocDir
fdc $DocDir > /dev/null
print "Changing directory and Finder display to $PWD"
else
command cd $DocDir
print "Changing directory to $PWD"
fi
AppleScript not needed
As excited as I was about this hint, I just realized that it's not even necessary. If you have the TextMate icon on your Finder window toolbar (and really, you should, because it allows you to simply drag-and-drop any file onto it to open in TextMate), all you have to do is drag the Finder window's proxy icon (the small one next to its name in the top menu bar) onto the TextMate icon. Ta-da! No AppleScript needed!
Open anything in TextMate via an AppleScript
But then again, you can save this script as an application, then us QS' "Open With.." command for a quick keyboard-only approach.
Open anything in TextMate via an AppleScript
You don't need to save anything to do this in Quicksilver. It'll work "out of the box". Just hit
⌘⎋ ⇥ ow ⇥ tm ↩In case those characters don't come through correctly, that was Command-Escape, Tab, ow, Tab, tm, ReturnI don't have Front Row, but I think it uses Command-Escape, so in that case, you can just bring up Quicksilver the usual way and hit ⌘G (Command-G). Enjoy! |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.59 seconds |
|