Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm learning Chinese and want a way to quickly generate and save words and phrases to m4a files.

I've managed to do pretty much what I want in terminal, but I can't seem to figure out how to make an app out of it. Here is the code I've used in terminal:

cd ~/Desktop/test
say -o "whateveriwantittosay.m4a" "whateveriwantittosay"

How do I make an shell or Apple script that when opened prompts me for whateveriwantittosay, then creates the file? And maybe even asks me again for a new file.


share|improve this question
If you add a function like cnsay() { for a; do say "$a" -o ~/"Desktop/$a.m4a"; done; } to ~/.bash_profile, you could run it with something like cnsay word1 word2. – user495470 May 11 '13 at 15:28
up vote 1 down vote accepted

Simple Automator Application :

  • Create a new Application
  • Add a Ask for text action
  • Add a Run a sheel script action
  • Select Pass input as Arguments
  • Copy the following script (Assuming ~/Desktop/Test exists)


cd ~/Desktop/Test
say -o "$@.m4a" $@
  • Save your application. It's ready to use.
share|improve this answer
Perfect. Thank you! – Henrik May 11 '13 at 17:23

i would use python for this... since it is included in the vanilla OSX distibution.

Check wxPython together with pyApp assuming you mean a gui-based app..

Using python you can use subprocess in order to call any terminal command from python eg:

import subprocess"date")
share|improve this answer
As written this does not really answer the question. Can you provide a sample python script which accomplishes what the asker is looking for in the question? – patrix May 11 '13 at 15:10
Question was edited since i answered to specify a shell or applescript. – Mamonu May 11 '13 at 16:10
Python is ok as well – patrix May 11 '13 at 16:34

Your Answer


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.