Re: Script for Post.Office
Re: Script for Post.Office
- Subject: Re: Script for Post.Office
- From: George Priggen <email@hidden>
- Date: Sun, 07 Mar 2004 23:19:15 -0800
Anyone -
I have tried the following suggestion:
do shell script "/usr/local/post.office/post.office 2>&1 &"
It does not open PostOffice.
I also tried the following, which was not suggested:
do shell script "sudo /usr/local/post.office/post.office 2>&1 &" password
"userpassword" with administrator privileges
It opens PostOffice but the wheel continues without stopping.
Is there something wrong that I am doing?
George
>
From: Graff <email@hidden>
>
Date: Sun, 07 Mar 2004 23:29:39 -0500
>
To: AppleScript Users <email@hidden>
>
Subject: Re: Script for Post.Office
>
>
If you do background the command don't forget to divert stdout and
>
stderr to /dev/null or else the script will still wait around for the
>
command's output:
>
>
do shell script "/usr/local/post.office/post.office 2>&1 &"
>
>
You can find more information about this topic and about the "do shell
>
script"command here:
>
<http://developer.apple.com/technotes/tn2002/tn2065.html>
>
>
However, I totally agree with Andrew. If you want to do this right,
>
use a proper startup script. It's not really hard and Apple has a
>
tutorial page on that also:
>
<http://developer.apple.com/documentation/MacOSX/Conceptual/
>
BPSystemStartup/Tasks/CreatingStartupItems.html>
>
>
-Ken
>
>
On Mar 7, 2004, at 10:38 PM, Andrew Oliver wrote:
>
>
> Umm... No. The first process won't finish, so the second one still
>
> won't get
>
> run.
>
>
>
> Additionally, since Post.Office's parent process is the script, it will
>
> likely die when it's parent process quits, so killing the script will
>
> probably kill post.office anyway.
>
>
>
> The 'correct' solution (at least as far as 'do shell script' is
>
> concerned)
>
> is to append '&' to the end of the shell process which tells it to
>
> background, returning control to the script while leaving the child
>
> processes running:
>
>
>
> do shell script "/usr/local/post.office/post.office &"
>
>
>
> However, I still maintain the correct method of doing this is via a
>
> normal
>
> startup script in /System/Library/StartupItems, and controlled via the
>
> normal /etc/hostconfig file.
>
>
>
> There are many reasons for taking this approach, not least is the
>
> ability to
>
> define dependencies (e.g. don't start Post.Office unless the network
>
> is up).
>
> I'm astounded that Post.Office doesn't come with a pre-installed
>
> script just
>
> for this purpose.
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.