• 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: Applescript to write answers to individual file names
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Applescript to write answers to individual file names


  • Subject: Re: Applescript to write answers to individual file names
  • From: Roger Howard <email@hidden>
  • Date: Wed, 7 Dec 2005 14:58:04 -0800


On Dec 7, 2005, at 1:01 PM, David Thompson wrote:

Hello everyone,

I am new to this board and am glad I have found it. I am trying (ha ha trying) to figure out how to write an applescript (or build it through automator) in which the script does the following:

take the input from a popup window: enter your user name, and takes the answer and writes it into a file in /tmp/uname
I also would like the popup window to ask for the users" password and take that answer and write it to a file in /tmp/passwd
I need to have 2 separate files.


The reason I need this is I need to have a user friendly interface in order to question users for their username and passwords and then take those 2 answers and write them into another file within the system.

I know that in UNIX scripting its easy to write the file such as: username answer > /tmp/uname

This doesn't appear to work the same in the applescript world.
Any help that I might be able to get on this subject would be greatly appreciated as I am lost on the whole applescript world.


I apologize if this topic has been covered in length before.

Ouch... well, assuming you already know what a terrible idea it is to write someone's password out in plain text like this... it's quite easy to do in many ways. First, get your value into an applescript varial:


set theUsername to text returned of display dialog "Whats your username" default answer "me"

Then write out that variable to the file of your choice... in fact you could use the exact same method as you mentioned above, just calling it via an Applescript command:

do shell script "echo " & quoted form of theUserName & " > /tmp/uname"

Seriously though, if a consultant did something like this with my users and their password it wouldn't be a long relationship. Chances are there is a much better way to get the login details from the users to whatever app you're feeding without doing this.

-R

_______________________________________________
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: 
 >Applescript to write answers to individual file names (From: David Thompson <email@hidden>)

  • Prev by Date: Applescript to write answers to individual file names
  • Next by Date: Re: waiting for Mail to complete a send
  • Previous by thread: Applescript to write answers to individual file names
  • Next by thread: Re: Applescript to write answers to individual file names
  • Index(es):
    • Date
    • Thread