• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Reading from background processes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Reading from background processes


  • Subject: Reading from background processes
  • From: Björn Lundin <email@hidden>
  • Date: Wed, 4 Jan 2006 21:57:42 +0100

Hi list!
As new to the list and new to applescript, I've been reading some of the lastest threads,
especially the ones concerning 'do shell script'

How do I run a program in the background, reading data from its stdout?

Googling, and looking in the threads has lead me into something like

1 - run the process in the background
2 - redirect stdout to a file
3 - read output from file

Now, say the background process writes percent completion of what it is doing to stdout. (redirected to known file)

What I want is a dialog, with a progress bar, that reads the percentage, and updates
the progress bar. 

is this something that will fit in an 'on idle' event?

on idle theObject
 --pseudocode
  if file exists then  (shellscript removes file when background process done)
    read last row in file
    update progress bar
    return 1
  else
    return 0  --reset idle handler?
  end if
end idle

or is there a better place/event/method?

Another thing, is there a _good_ tutorial somewhere, or recommended reading?



/Björn


Björn Lundin

bnl at spray dot se


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Reading from background processes
      • From: Adam Bell <email@hidden>
  • Prev by Date: Re: get size of available screen fails
  • Next by Date: Re: get size of available screen fails
  • Previous by thread: Re: Need help with image events droplet to save multiple files as png
  • Next by thread: Re: Reading from background processes
  • Index(es):
    • Date
    • Thread