PDA

View Full Version : Open-in-textmate rewrite for pathfinder


Helmi
Nov 09, 2008, 11:09 PM
Hi,

unfortunately i'm everything else but a apple script guru. Probably somone can help rewriting this apple script for pathfinder. Originally it was an app that brings a textmate button to finder and opens files or folders on click or drag in textmate. I'm so completely used to it so i wanted to port it to pathfinder.


-- Opens the currently selected Finder files, or else the current Finder window, in TextMate. Also handles dropped files and folders.

-- By Henrik Nyh <http://henrik.nyh.se>
-- Based loosely on http://snippets.dzone.com/posts/show/1037

-- script was clicked
on run
tell application "Finder"
if selection is {} then
set finderSelection to folder of the front window as string
else
set finderSelection to selection as alias list
end if
end tell

tm(finderSelection)
end run

-- script was drag-and-dropped onto
on open (theList)
tm(theList)
end open

-- open in TextMate
on tm(listOfAliases)
tell application "TextMate"
open listOfAliases
activate
end tell
end tm


And after converting the code...what would be the best way to start this script? Also insert it as a button in pathfinder? Is that possible?

Thanks for helping!

syoutsey
Nov 17, 2008, 08:44 PM
Hi,

unfortunately i'm everything else but a apple script guru. Probably somone can help rewriting this apple script for pathfinder. Originally it was an app that brings a textmate button to finder and opens files or folders on click or drag in textmate. I'm so completely used to it so i wanted to port it to pathfinder.


-- Opens the currently selected Finder files, or else the current Finder window, in TextMate. Also handles dropped files and folders.

-- By Henrik Nyh <http://henrik.nyh.se>
-- Based loosely on http://snippets.dzone.com/posts/show/1037

-- script was clicked
on run
tell application "Finder"
if selection is {} then
set finderSelection to folder of the front window as string
else
set finderSelection to selection as alias list
end if
end tell

tm(finderSelection)
end run

-- script was drag-and-dropped onto
on open (theList)
tm(theList)
end open

-- open in TextMate
on tm(listOfAliases)
tell application "TextMate"
open listOfAliases
activate
end tell
end tm


And after converting the code...what would be the best way to start this script? Also insert it as a button in pathfinder? Is that possible?

Thanks for helping!

Hey there, I would love for this to work under PF as well. I'll give it a shot but know next to nothing about AppleScript. I'll let you know if I can get it to work but don't count on it.

lumptoe
Dec 02, 2008, 07:44 AM
As a TextMate Fanatic, I just drag Application Icon into the Path Finder's toolbar. When I want to open any folder or file I just drag & drop the item over the icon.

Helmi
Dec 27, 2008, 10:21 PM
Yeah that basically works but opens textmate a different way the script above does. Guess that depends on the open selection as alias part. That makes opened folders to projects in textmate which makes handling them a lot easier.

Dewer
Mar 02, 2009, 03:58 PM
I know this is kindof an old post, but I'm sure others are looking for this functionality still. I got to this thread from a google search because I wanted this myself.

Someone posted a solution to this here: http://blog.circlesixdesign.com/download/open-in-textmate/