• 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: Simple apple script - Beginner Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple apple script - Beginner Problem


  • Subject: Re: Simple apple script - Beginner Problem
  • From: "Mark J. Reed" <email@hidden>
  • Date: Wed, 15 Jul 2009 10:19:56 -0400

On Wed, Jul 15, 2009 at 6:38 AM, James Bensley<email@hidden> wrote:
> Hey list,
>
> I have been totally foolish and realised I was using the 'print'
> function within awk instead of 'printf' which solved my issues

Confusing "print" and "printf" when using Awk is not "foolish".  It
has been said that using Awk at all is foolish, which is not a
position I share, but it is in any case a very different beast than
AppleScript, and its syntax can be more than a little confusing.  Awk
was in many ways the prototype for Perl.  (If you're of a certain age
and this use of "prototype" makes you think of KARR/KITT or Lore/Data,
you're on the right track.)

> property user_name : ""
> set user_name to "" # Added in because sometimes the script would magically remember the values of its last run despite being terminated?

Huh, AppleScript supports # comments now.  I guess that makes sense
given the #! support.

Value persistence between runs is a feature of properties.  If you
don't want the values to persist, you can just remove the "property"
line.  But if you don't want the value to persist, why do you check to
see if it's empty?  Just prompt for it every time:

        set user_name to text returned of (display dialog "Please
enter your username" ¬
                                                         default answer "")
        set password to text returned of (display dialog "Please enter
your password" ¬
                                                       default answer
"" with hidden answer)

Also, you set a variable to the AD domain name and then never use it
(your dscl command just looks under All Domains).
--
Mark J. Reed <email@hidden>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Simple apple script - Beginner Problem
      • From: James Bensley <email@hidden>
    • Re: Simple apple script - Beginner Problem
      • From: Jon Pugh <email@hidden>
References: 
 >Re: Simple apple script - Beginner Problem (From: Stan Cleveland <email@hidden>)
 >Re: Simple apple script - Beginner Problem (From: Simon Topliss <email@hidden>)
 >Simple apple script - Beginner Problem (From: James Bensley <email@hidden>)
 >Re: Simple apple script - Beginner Problem (From: James Bensley <email@hidden>)

  • Prev by Date: Re: Simple apple script - Beginner Problem
  • Next by Date: PhotoShop CS3 Tiff Save Option
  • Previous by thread: Re: Simple apple script - Beginner Problem
  • Next by thread: Re: Simple apple script - Beginner Problem
  • Index(es):
    • Date
    • Thread