Re: Ignore a script object or applet or what...?
Re: Ignore a script object or applet or what...?
- Subject: Re: Ignore a script object or applet or what...?
- From: Andrew Oliver <email@hidden>
- Date: Wed, 23 Feb 2005 23:41:19 -0800
On 2/23/05 10:59 PM, "Emmett Gray" <email@hidden> wrote:
> Hi,
>
> I'm trying to track the progress of a psync operation I've scripted,
> by using fstat to see if the psync output is still open. The reason I
> want to do this is because I want to do something else in the script
> while psync is running (it could run for quite a while). I would plan
> to use an idle handler to run fstat periodically. I'm using the
> following code:
>
> do shell script ("/usr/local/bin/psync " & theSource & " " & theDest
> & " > ~/Library/Logs/" & logName)
> do shell script "fstat ~/Library/Logs/" & logName
>
> What is happening is that fstat doesn't get a chance to run until the
> psync operation is finished, so it always reports the logfile as
> closed. Can I create a script object or other object in which to put
> the psync action which I could then ignore and proceed to the next
> script step while it runs?
Standard 'do shell script' stuff. To background a shell script task you need
to append ' > /dev/null 2>&1 &' to the end of the command. This suppresses
output and returns control to your AppleScript while the process runs in the
background, so:
_______________________________________________
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