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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:11:00+00:00 2026-05-12T19:11:00+00:00

I am trying to create a simple Automator droplet that will take the style.less

  • 0

I am trying to create a simple Automator droplet that will take the style.less file dropped into it and run the following LESS command on it:

$ LESSC {DROPPED_FILE} --watch

which will monitor the file I have dropped in for any changes and will then automatically update the outputted style.css

FYI: I am using LESS to have dynamically written CSS files. More info is here.

The basic droplet works great.

  1. The dropped file is passed into a variable; For this purpose: {MY_VAR}.
  2. I run a shell script in the /usr/bin/ruby shell as follows system("lessc {MY_VAR} --watch &")

this works great however I want the –watch to be stopped upon quitting the automator app.

The LESS documentation says to press the CTRL-C shortcut while in the command line shell to abort the script.

But since I am not inside the terminal window (command is being passed in the background) I don’t know how to abort the script.

Even after the automator.app has been closed the style.less file is still being watched for changes and the correspondingly generated style.css is still being rewritten.

So basically I need to pass the abort command on exit of the .app.

I have generated a simple pop up that on click will close the app after passing another command to the terminal shell.

This is the part where all my tries have been unsuccessful to stop the script.

Is there a command line function that acts the same as pressing the CTRL-C command?
How would I pass this the best to the shell?

  • 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-12T19:11:00+00:00Added an answer on May 12, 2026 at 7:11 pm

    If you press CTRL-C in your console, this is not send via STDIN to your programm. Bash(or whatever you use) treats CTRL-C special. The bash sends a signal to the process. In case of CTRL-C this is SIGINT. To send a signal to a program you need to no it’s pid. Then you can send the signal to the pid. To be able to get the pid you can start the process with ruby.

    p= IO.popen("lessc #{file} --watch")
    pid= p.pid
    Process.kill("INT", pid)
    

    In ruby there are at least 3 different ways, of executing something.

    `lessc #{file} --watch` # returns stdout after exit
    system("lessc #{file} --watch") # returns the integer return value after exit
    Io.popen("lessc #{file} --watch") # returns imidietly an io object, where STDIN and STDOUT can be written and read
    

    You used system("lessc #{file} --watch&") which also returns imidietly but always returns 0.

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

Sidebar

Related Questions

No related questions found

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.