2

Since setting Textmate to open html files by default, it tries to open links inside Tweetdeck. If I switch it back to opening html files in a browser, it is fine, but I want to open html files in Textmate. alt text

(The mash.to was a link from a shortened url from Mashable (work safe link)): http://mash.to/2FFQZ

Has anyone else come across this problem and knows how to fix it?

I am on a Mac.

danixd
  • 1,524

5 Answers5

1

I'm not familiar with TweetDeck, but the standard for link files (i.e. files that open to a web address) are .webloc, not .html. You should be able to set .html files to open in TextMate (this is what I have on my Mac), but if TweetDeck is also creating .html files instead of .webloc files, then that's going to be a problem: you can't really have it both ways.

However, if there are only certain html files you want to associate with TextMate, you can do that: select the file, Get Info, and change the application under "open with". I suspect that's not really a solution for you though.

Maybe check the file association for webloc files on your system: drag a web page's favicon from your safari address bar to the desktop, and Get Info on that. (Mine say "Finder".)

I just tried installing TweetDeck to test this out, and it all seems to work for me, so there must be a way:

  1. Clicking links in TweetDeck opens them in Safari
  2. Double-clicking html files in the Finder opens them in TextMate

How is TweetDeck even giving you html files from links? That's strange.

Andrew Vit
  • 1,070
1

I too have had this problem, one thing that doesn't completely solve the problem but helped for me is:

You can set .html to open in Chrome (or whichever browser) and .htm files to open in TextMate by default. Do this by right-clicking a .html/.htm file, selecting "Get Info", and changing the "Open with" application, then clicking "Change all".

enter image description here

Then if you change all your .html files to .htm it should open them in TextMate. Again, this is not a perfect solution but a good workaround for me.

slhck
  • 235,242
Dowd
  • 11
  • 1
0

Not a Mac user, but from your question I get the impression that you are trying to open http://mash.to/2FFQZ in TextMate.

If what you want is to examine an HTML file from the Internet, the solution to the problem is to change the browser's "View Source" default editor to TextMate, rather than trying to open all HTML files in TextMate. This article describes the process for Firefox. This will enable viewing the Internet normally, passing to source only when required.

Another solution, in the browser itself, is to use a developer tool such as Firebug for Firefox. This will let you examine the source in greater detail, including the CSS.

As far as I can see, you can't use TextMate to edit file directly from the Internet.
The TextMate manual Calling TextMate from Other Applications says about the URL Scheme:

The txmt URL scheme allows you to open files in TextMate via hyperlinks found for example in HTML documents (anchors). These can refer to local files

My impression is that TextMate can only open HTML files locally from the computer, and not from the Internet.

This impression is reinforced by the answer to the thread from July 2009
Problem "Unknown URL Scheme" -- Adobe AIR + TextMate:

Problem: Just to be clear, if I were to click a link "http://adobeairbug.com/", it would display the error "Unknown URL Scheme - This version of TextMate does not support “adobeairbug.com” in its URL scheme.

Answer: The default program to open .html or .php or whatever file you're trying to navigate to is set to open in TextMate. Change the default program to an internet browser.

harrymc
  • 498,455
0

danixd: you shouldn't be setting a text editor as the default program for opening html in OS X. As far as I know, OS X has no separate setting for opening files vs editing them... i.e. right clicking on a file and choosing edit rather than open. So using "change all" like you seem to have done causes all html links to open in TextMate.

Can you just use a right-click (or control-click), and then choose open with -> TextMate, when you want to open an html file for editing? Alternatively, you can drag html files or links onto the TextMate icon or into the TextMate window to open them for editing...

on edit:

There's no way that you'll be able to set TextMate as the default html application without messing up other things you want to do like clicking links in TweetDeck and having them open in a browser. Unfortunately you can't have it both ways, it's the same in Windows.

However, there is another option. You can create a new service and set a keyboard shortcut for it. I just tested it and it works:

  1. Open Automator

  2. Choose new Service

  3. Change the drop down box below the toolbar to "files or folders"

  4. Drag the action "Open Finder Items" (under "Files and Folders") into the workflow below the toolbar

  5. Choose "TextMate.app" in the Open With list

  6. Save your service as "Edit with TextMate" or whatever you want to call it

  7. Open System Preferences --> Keyboard --> Keyboard Shortcuts --> Services

  8. Scroll to your new Service under "Files and Folders"

  9. Make sure it's checked, and click the white space on the far right of the service name

  10. type some keyboard shortcut you want to use when an html file is selected and you want to open it in textmate

  11. voila

Robert S Ciaccio
  • 1,660
  • 4
  • 20
  • 25
0

From TweetDeck URL Fix: How I Got TweetDeck URLs Back Into My Browser, Where They Belong!

With the knowledge that I had it backed up in several different places, I deleted TextMate. Poof!

Then I clicked a URL in TweetDeck. Incredibly, it went to Safari (not my default browser). But it was a start!

Then I went into Safari’s preferences and made sure my default browser was, in fact, set to Firefox. Then I closed Safari, closed TweetDeck, reopened TweetDeck, and clicked another link.

It went to Firefox, new tab and everything. SUCCESS!

When I restored TextMate to its former happily-installed glory, the URLs continued to go straight to Firefox. And I was fixed!

harrymc
  • 498,455