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.

I have text in ~/myfile.txt and I'd like to be able to "type" it into the current application, which will probably be TextMate or Terminal

I'd like to see if I can have this happen without using the clipboard. Quicksilver has a cool action called "Type Text", but it works with the current selection and doesn't pull the text from a file:

enter image description here

I tried using Quicksilver's "save command to file" option, which would save this as "Type My Text.qscommand", which I could then modify on the fly and replace the "text" that was inside of this file, and my thinking was to have that run which would type the text, but apparently even without modifying the file this command does not work if it is saved to a file and executed.

enter image description here

So my other thoughts - possibly use

  • Typinator
  • Textexpander
  • Applescript
  • maybe some other macro program?

to set up a way that I can type text from a file (~/myfile.txt) into the current application, but I'm not sure how to go about doing that.

share|improve this question
    
Try Alfred instead of Quicksilver! Has a nicer UI and better search ;) –  Will Feb 13 '13 at 22:11

2 Answers 2

up vote 0 down vote accepted

Here's something that works if your text is only one line : Select your text file in the first pane, right arrow in it, then choose Paste from the action pane.

I think you need the Text Manipulation plugin to be able to right-arrow into text files.

share|improve this answer

You can do this using Automator. Select to create a Service that receives no input in any application whose Output replaces selected text (you don't actually need a text selection for this to work).

  • Add a Get Specified Finder Items action, and add myfile.txt to its list. You could alternatively hardcode the file path below and skip this step.

  • Then, add a Run Shell Script action, and pass input as arguments. Replace the default echo command by cat.

This will cause the file contents to be the output of your service, which will be added to the current document you're editing.

enter image description here


TextMate works as expected.

Terminal ignores a single trailing newline when inserting the text, i.e. you need two if you want to directly execute the last line as a command.

share|improve this answer
    
cool. will give it a try. btw are you a quicksilver user? –  cwd Jan 14 '12 at 22:23
    
@cwd launchbar, since quicksilver messed up its index once too often. I use it for nothing fancy though, just launching, spotlight and calculator. –  Daniel Beck Jan 14 '12 at 22:46
    
maybe give it another try since they have a new version and you're a power user... –  cwd Jan 15 '12 at 4:35
    
@cwd Did it work for you? –  Daniel Beck Jan 20 '12 at 19:55
    
still exploring. don't worry i will get around to accepting it :) –  cwd Jan 20 '12 at 20:03

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.