• 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
Re: Reading from background processes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading from background processes


  • Subject: Re: Reading from background processes
  • From: Adam Bell <email@hidden>
  • Date: Wed, 4 Jan 2006 21:07:11 -0400

You might try asking Bruce Phillips for a copy of his BP Progress Bar that is now in development. I have a beta copy that works well. He can be reached at Bruce {at} macscripter.net

On 1/4/06, Björn Lundin <email@hidden> wrote:
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      (



--
Some minds remain open long enough for a truth to both enter and leave without processing.
 _______________________________________________
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

References: 
 >Reading from background processes (From: Björn Lundin <email@hidden>)

  • Prev by Date: Re: How do I delete the 1st three characters from a variable
  • Next by Date: Re: How do I test if app is running / file is open?
  • Previous by thread: Reading from background processes
  • Next by thread: mounting ejected volumes
  • Index(es):
    • Date
    • Thread