Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: Use Automator to view any file in a text editor Desktop
Tiger only hintIf you download a text file from the internet, like a ReadMe or a .nfo file, it usually doesn't open in TextEdit unless you explicitly tell the Finder to do so for each and every file you download. You can use the 'Open With' contextual menu, of course, but this menu usually includes a lot of options for generic text files -- so it takes a while to display, and then to scroll through to find TextEdit. You can also, of course, help the Finder learn about each type of generic text file you may download (by using Get Info and changing the default application), but this can be tedious and you may not actually wish to change the default application.

The solution is to create a simple Automator action to open the currently selected file(s) in TextEdit, and install it as a Finder plug-in:
  1. Launch Automator and click on Finder in the Library column.
  2. In the Action column, drag Open Finder Items to the empty area on the right-hand side.
  3. In the Action itself, click the Open with pop-up and set it to TextEdit (or the text editor of your choice).
  4. Select File: Save as Plug-in.
  5. In the dialog that appears, enter the name you want to give to the plugin (eg. View in TextEdit) in the 'Save Plug-in As' field, and set the 'Plug-in for' pop-up to Finder.
  6. Click the Save button.
From now on, you can select any file or files you want to view, control-click on one of them, and select the option View in TextEdit (or whatever name you used) from the Automator sub-menu. This is much quicker than using the Finder's huge Open With menu.

Note: This hint was originally submitted by an anonymous contributor, with a link to a downloadable action. However, the link was broken, and there was no contact information included with the submission, so I couldn't contact the author. I thought the concept sounded useful, however, so I played with Automator for a couple minutes to create my own version of the action. So thanks to the submitter, whomever you were, for the idea to create this simple plug-in.
    •    
  • Currently 3.25 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
 
[13,152 views]  

10.4: Use Automator to view any file in a text editor | 10 comments | Create New Account
Click here to return to the '10.4: Use Automator to view any file in a text editor' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Use Automator to view any file in a text editor
Authored by: tinb on Aug 16, '05 10:53:13AM

You can always drag&drop any (!) file onto the TextEdit icon to open that file. This works with TextEdit in Dock or in Finder view.
Sometimes applications are not able to recognize the correct file type and refuse to accept a specific file. Then D&D onto the icon will not work. To force this application to open a file, hold Option-Command while dragging around.



[ Reply to This | # ]
10.4: Use Automator to view any file in a text editor
Authored by: hamarkus on Aug 16, '05 02:16:28PM

Right, dragging a file onto a dock icon is in my humble opinion much faster than navigating through a pop-up menu, you certainly have to think less, which speeds up things for me a lot.



[ Reply to This | # ]
10.4: Use Automator to view any file in a text editor
Authored by: osxpounder on Aug 16, '05 02:26:15PM

If dragging and dropping works for you, that's great. For some of us, the less mouse dragging, the better -- that puts a lot of strain on our poor, tired and worn out mouse hands, and it's a relief to be able to get rid of some drag & drop moves, esp. ones that you find yourself repeating over & over.

I'm still not working in Tiger yet, so I'm keeping TextEdit in the Dock and drag/dropping to it, but I'll really appreciate this tip once I'm ready to work in Tiger. I tried doing what this tip accomplishes in another way, using the Mouse & Keyboard prefs panel to assign a key combo to Services->Open Selected File, but apparently that menu item's too deep in the stack -- the key combo won't work.

What I'd really like is a way to right-click selected text and immediately have "New Window Containing Selection" [new window in TextEdit, that is] on the contextual menu. I tried figuring out how to do that in Automator, but couldn't figure it out easily.

---
--
osxpounder



[ Reply to This | # ]
service shortcuts
Authored by: sjk on Aug 16, '05 06:32:59PM

You can assign a keyboard shortcut for the New Window Containing Selection service in System Preferences->Hardware->Keyboard & Mouse->Keyboard Shortcuts. That's also useful for reassigning shortcuts for services that conflict with each other (e.g. shift-command-U for Open URL in <browsername> is a common conflict).



[ Reply to This | # ]
10.4: Use Automator to view any file in a text editor
Authored by: hamarkus on Aug 16, '05 06:59:32PM

O.k., I guess as an avid trackpad user (I have even started to look for external keyboards with trackpads) and therefore having only have to move my index finger for dragging and dropping, I have different preferences to mouse users.



[ Reply to This | # ]
10.4: Use Automator to view any file in a text editor
Authored by: rhowell on Aug 16, '05 11:04:47AM

Note that you can also create Automator plugins in this way to mimic a nice feature in Windows: the "Send To..." command in a contextual menu. Ctrl-click, Send To Desktop, Send To AFP Server, Send To Drop Box, etc, etc.



[ Reply to This | # ]
10.4: Use Automator to view any file in a text editor
Authored by: ob1cannoli on Aug 16, '05 12:26:12PM

I'm not using 10.4, but 10.3 has a really nice "Open Selected File in Text Edit" in the Services Menu. Just look under Apple->Services->TextEdit->Open Selected File.
For non-Tiger users, this works just as well.



[ Reply to This | # ]
10.4: Use Automator to view any file in a text editor
Authored by: messy on Aug 17, '05 03:09:00PM

This is perfect for me. I have hundreds of html files, some open in Safari, some in BBEdit. Now it is much faster to right click on the files I want to revise in BBEdit. Thank you, thank you, thank you.



[ Reply to This | # ]
Even easier solution
Authored by: q-wert on Aug 17, '05 11:05:20PM

There's an even easier solution to all this.

1 - Select the file you always want to open by TextEdit, say the .nfo.
2 - Get Info (Commad-I)
3 - In the 'Other With Pane' select TextEdit (you'll most likely need to choose the 'Other…')
4 - You might want to check 'Always Open With' as your choosing TextEdit
5 - Press the button 'Change All…' to apply to all NFO files.



[ Reply to This | # ]
Or use a quick command in Terminal.app
Authored by: stomaphagus on Aug 31, '05 11:09:29PM
At the prompt, type
open -a /Applications/Whatever.app/ your_file_to_be_opened
For example, if I wanted to see a Photoshop file without waiting for Photoshop to launch (500MHz iBook!), I'd type
open -a /Applications/Preview.app/ ClientLogo.psd
Works like a charm, esp. when you use tab to auto-complete what you're typing. It's quicker than using any graphical Open With whatzit.

[ Reply to This | # ]