Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
    
did you try the automator suggestion? –  Robert S Ciaccio Sep 30 '10 at 6:09
add comment

5 Answers 5

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.

share|improve this answer
    
Yes that would be the answer, if I didn't work as a web developer and have to open html files in TextMate :( It also opens normal urls in the same way (....) –  danixd Sep 24 '10 at 12:53
    
Do you mean that there are Internet urls that do open successfully in TextMate? –  harrymc Sep 24 '10 at 12:56
    
@harrymc I click on a url in TweetDeck and TextMate shows me the error I posted in the question. –  danixd Sep 24 '10 at 13:44
    
I understand then that you have never succeeded in using Internet in TextMate, which probably means that the above sources are correct : you cannot. Why do you have to open html files in TextMate? –  harrymc Sep 24 '10 at 15:13
1  
@harrymc: TextMate is a text editor, so I assume he has to open html files in it to edit them... but I think you're on the right track. @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. –  Robert S Ciaccio Sep 25 '10 at 1:55
show 4 more comments

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

share|improve this answer
    
I can, but it is not answering my question. I am clicking on HTML files a lot, and its a massive pain having to right click > open as. As far as I can tell from the answers on this page, it seems you are correct on the point about changing html to open with a text editor as default. I can change .html to open with a browser and any link type will open in that browser, examples; google.com/index.html & bit.ly/DyE5 –  danixd Sep 27 '10 at 9:18
    
@danixd see my updated answer for another way to do it –  Robert S Ciaccio Sep 27 '10 at 15:48
add comment

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!

share|improve this answer
    
This worked to make TweetDeck open URLs, but it was just a massively long way of changing file association, heh! Once I restored TextMate and the urls were opening in Chrome, the .html files were re-associated with Chrome, so when I click on them, they open in the browser, not TextMate. –  danixd Sep 28 '10 at 9:25
    
So the problem is fixed? –  harrymc Sep 28 '10 at 12:03
    
No, I already knew how to revert back to TweetDeck links opening in the browser, but that involves changing the .html file association, which is what I don't want to do. –  danixd Sep 29 '10 at 9:41
add comment

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.

share|improve this answer
    
.webloc files open with finder as default. I changed .html to open with TextMate and .webloc to open with Safari, and no luck. Tweetdeck isn't 'creating' html files. Users tweet links and when I click on those links, textmate tries to open them. I wish mine worked the way yours does! –  danixd Oct 12 '10 at 9:11
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.