Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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 trying to run a shell script wherein I run the screencapture command, do a couple of modifications like file renaming, moving to Dropbox, shortening the url etc and then growling the url.

Problem is, after running the "screencapture" terminal command, following commands aren't executed like so:

screencapture -i ~/Dropbox/Public/ScreenShot_TestScreenShot1.png
# below doesn't get executed
echo "your file is at ~/Dropbox/Public/ScreenShot_TestScreenShot1.png"

(For the curious: The shell script is triggered from from Alfred)

Anyway of returning to the shell script after running the screencapture command?

share|improve this question
Are you certain the echo isn't being run? And that the Terminal window that Alfred pops up just isn't being destroyed before you can see the echo? Try adding a sleep 60m to the end of the script after the echo command to keep transient windows alive on the screen. – Ian C. Mar 1 '12 at 14:27
You're right Ian! Alfred basically has this Growl enable checkbox, which I didn't enable, so the output wasn't getting captured anywhere – Kaushik Gopal Mar 1 '12 at 14:42
up vote 4 down vote accepted

The problem isn't that control is not being returned to your script, it's that the output from the echo command isn't being captured and reported to you. It could be that Alfred is closing the transient window that it's using to run the script. To test that add a sleep 60m to the end of the script which should keep the window on the screen.

Or it could be that all stdout/stderr from the script is going to /dev/null or something similar. Make sure Alfred isn't throwing away the output. Based on our comment conversation it sounds like that's what Alfred does with std I/O.

share|improve this answer

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.