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

10.3: Create text files with enhanced open command UNIX
I ran across this accidentally when I typed 'open' in terminal and forgot to include any arguments.

$ open
Usage: open [-e] [-a <appname>] [filenames]
Help: Open opens files from a shell.
      By default, opens each file using the default application for that file.  
      If the file is in the form of a URL, the file will be opened as a URL.
      -a  Opens with the specified application.
      -e  Opens with TextEdit.
      -f  Reads input from standard input and opens with TextEdit.
Typing open -f works much the same way as cat > somefilename, with the end of input being indicated by hitting Control-D, with the result being a new TextEdit document. Unfortunately, there doesn't seem to be a way to specify the name of the document.

I didn't remember seeing this before, and verified that it did not exist in 10.2.
  • Currently 2.57 / 5
  You rated: 5 / 5 (7 votes cast)

10.3: Create text files with enhanced open command | 3 comments | Create New Account
Click here to return to the '10.3: Create text files with enhanced open command' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
example of use
Authored by: hayne on Dec 24, '03 02:18:09PM
This is most useful when you pipe the result of some other command to it.
ls -l | open -f
gives a new TextEdit window with the contents of the current directory.

There is no filename associated with this window since the document has not yet been saved. And in fact (this seems like a bug), TextEdit doesn't warn you if you close the window without saving.

[ Reply to This | # ]

10.3: Create text files with enhanced open command
Authored by: liquidgood on Dec 24, '03 03:35:09PM

i tried this and i got a text file in /tmp/501/TemporaryItems/ called 3C033808-3650-11D8-8790-0003939B3DF4-1626-000003B1FF08D1CD.txt.
it appears to save the text file and then open it, at least for me (running 10.3.2).

[ Reply to This | # ]
10.3: Create text files with enhanced open command
Authored by: sabi on Dec 25, '03 04:12:34PM
If you are using an editor which supports stationery (BBEdit, Tex-Edit Plus, etc.) you may find the behavior of my launch utility more useful; it writes a stationery text file and opens it, so it shows up as an untitled document rather than getting a gigantic long UUID name.

Use it as:

ls -l | launch -

[ Reply to This | # ]