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 9241135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:18:58+00:00 2026-06-18T08:18:58+00:00

I have an Automator script for a service that looks like this: Receives as

  • 0

I have an Automator script for a service that looks like this:

Receives as text in any application. Input is entire selection, does not replace selected text.
-> Run Shell Script (/bin/bash) "expand -t 4" pass input to stdin
-> Copy to Clipboard

No other options set. The idea is that I can select some code, and put a detabbed version in the clipboard without having to paste the code into BBEdit for detabbing.

The service yields only the first line of the selected text. Deleting the shell-script action puts all of the selected text onto the clipboard. Running

expand -t 4 < /path/to/tabbed.file > result.file

yields the converted contents of the whole input file. Replacing the command with “wc” shows reasonable counts for lines, words, and characters.

So the problem seems to be in passing a selection of more than one line into expand(1) by standard input from an Automator service’s input. I don’t see anything relevant from the expand(1) man page.

What am I doing wrong?

  • 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-06-18T08:18:59+00:00Added an answer on June 18, 2026 at 8:18 am

    Try this AppleScript:

    on run {input}
        set the clipboard to (do shell script "expand -t 4 <<< " & quoted form of (input as text))
    end run
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an automator script that I'd like to run on a folder. I
I have a file, cache.md , that starts off like this: # 2012-05-09.8271 CACHE
I have tried creating an application in Automator that when double clicked, will tar
I am writing a bash script for an automator service that will take a
I have created an Automator workflow service (not Automator application!) under Mac OS X
I have written a simple automation script for deploying and restarting my twisted application
For automated testing (using Hudson) I have a script that generates a bunch of
I have an Automator Application containing the action Show Growl Notification, which is always
So I have a script in ruby that obviously uses variables. Part of the
I currently have a script that takes 1,000 rows at a time from a

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.