Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6975573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:23:08+00:00 2026-05-27T17:23:08+00:00

So, I like to use TextWrangler for editing code in OSX, and I tend

  • 0

So, I like to use TextWrangler for editing code in OSX, and I tend to use a terminal to control my workflow. Generally, I use a bash alias:

alias text='open -a /Applications/TextWrangler.app'

However, this method doesn’t allow me to open new files on the fly from the prompt. For example, if I typed emacs newfile.py it would temporarily create a new file, but not touch it until I actually saved the file. With my alias, though, if newfile.py doesn’t exist, then I get an error, and have to manually touch the file then open it.

Any suggestions on hidden ways to use open that solve this? Or third-party alternatives to the open command? Or is this just a fundamental limitation of GUI-based editors?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:23:09+00:00Added an answer on May 27, 2026 at 5:23 pm

    I think you want a full-fledged shell script rather than just an alias. Make a file with these contents:

    if [ -e "$1" ]; then
      open -a TextWrangler -- "$1"
    else
      touch "$1"
      open -a TextWrangler -- "$1"
    fi
    

    Save it as text somewhere in your PATH and chmod it to be executable and you’re golden.

    If you really want to make it so that the file doesn’t exist if you don’t save it, that’s trickier. I think you’ll have to do something like this:

    if [ -e "$1" ]; then
      open -a TextWrangler -- "$1"
    else
      touch "$1"
      open -a TextWrangler -- "$1"
      sleep 1
      rm "$1"
    fi
    

    This will actually create the file and then delete it one second later. The app will still have the file open, though, so that when you save it will be recreated.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have some perl code that goes something like: use strict; use XML::XPath;
I would like use unmanaged code from C in C#. I built a DLL
I would like test code in the lib directory of Rails. I use RubyTest
I am using AdoNetAppender (SQL server) in my asp.net application and would like use
I like to use static functions in C++ as a way to categorize them,
I like to use Emacs' shell mode, but it has a few deficiencies. One
I like to use IPython's zope profile to inspect my Plone instance, but a
Most websites use - (like Stack Overflow) but most PHP frameworks generate + encoded
I like to use markdown notation in my subversion commit messages, planning to one
I like to use MySQL to do quantitative analysis and statistics. I would like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.