• 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: About integers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: About integers


  • Subject: Re: About integers
  • From: Christopher Nebel <email@hidden>
  • Date: Wed, 2 Mar 2005 16:11:51 -0800

On Mar 2, 2005, at 7:54 AM, Francois Houle wrote:

Basically what I want ot do is this:

set Dialog_1 to display dialog "The application requires your administrative password to run: " default answer ""
set admin_user to the text returned of the result


Now what I would like to do is to have admin_user become a 32 bit unsigned integer that then gets writen properly to a basic text file.

OK, I'm being nit-picky here, but if you're writing binary data like a machine-representation integer to a file, it's not really a "text" file any more. This might be part of what's confusing people -- did you want to write the number in a human-readable form (e.g., "1234"), or did you want to write the machine-representation bytes?



display dialog "The application requires your administrative password to run: " default answer ""
set admin_user to the text returned of the result
(* walla walla hash magic *)
set fp to open for access file my_file with write permission
write pwhash to fp as text -- human-readable
write pwhash to fp as unsigned integer -- machine-readable unsigned 32-bit integer.
close access fp


Another question is why you're trying to do this. Asking for someone's admin password and then storing it somewhere else is in extremely poor taste, security-wise. (If this is for your own password database, then never mind.) There are ways to set timeout policy if you need to.


--Chris Nebel AppleScript Engineering _______________________________________________ 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: 
 >RE: About integers (From: "Francois Houle" <email@hidden>)

  • Prev by Date: Re: Events in iCal - how do you do recurrence?
  • Next by Date: Re: About integers
  • Previous by thread: Re: About integers
  • Next by thread: Re: About integers
  • Index(es):
    • Date
    • Thread