• 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: do script for background application...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: do script for background application...


  • Subject: Re: do script for background application...
  • From: Axel Luttgens <email@hidden>
  • Date: Mon, 11 Nov 2002 13:45:21 +0100

David Crowe wrote:

I'm trying to run an application (vpnclient) in the background via AppleScript:

The script below has a few flaws....

-- Run vpnclient. The VPN will be disconnected if this app quits
activate
display dialog "Enter password: " default answer "" default button 1
set thePassword to text returned of the result
with timeout of 30 seconds
do shell script "yes | /Applications/vpnclient/vpnclient connect xxvpn user myusername pwd " & thePassword
end timeout


Flaws:
1. "display dialog" doesn't appear to have a way to not echo back the input.


Right.
Standard AppleScript doesn't provide a way to hide a password while entering it.
Some OSAXen (scripting additions) provide such a tool (but ask to the list - I don't have any reference at hand for the moment).

2. The script hangs, and does not timeout. The dock shows "application not
responding" for it. It does start the vpnclient application, however.


I don't know vpnclient, but some questions nevertheless appear to me.
What's the "yes" appearing at the beginning of the command? Some text that vpnclient expects on its standard input? If yes, shouldn't your command begin with something like "echo yes | ..."?
On the other hand, you say you want to run vpnclient in the background; if this is in a unix sense, I guess your command should end with "&" and likely need some redirections.
But you speak about the dock... what kind of app exactly is vpnclient? A command line tool or a MacOS application?

If anybody knows how to fix those flaws, I would appreciate it.

Also, a more general question. Is there any way to run a shell script independently of the script (i.e. not terminate with the script)?


See the "On the other hand" part above.

HTH
_______________________________________________
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.

References: 
 >do script for background application... (From: David Crowe <email@hidden>)

  • Prev by Date: Re: Sorted - How to get Palm Desktop (v 2.6, OS9) to create new event
  • Next by Date: Re: "of machine" use?
  • Previous by thread: do script for background application...
  • Next by thread: GraphicConverter & saving files in new places
  • Index(es):
    • Date
    • Thread