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

Re: global variables


  • Subject: Re: global variables
  • From: Helmut Fuchs <email@hidden>
  • Date: Wed, 26 May 2004 23:46:13 +0200

Depending on how you use the script, the line that's setting the importpass variable is never run.

You could put this line in a run handler (if that is called):

on run
set importpass to my keychainpass("password") as string
end run

Or you could just check, if the value is defined, before using it and initialize it, if necessary:

try
importpass
on error
set importpass to my keychainpass("password") as string
end try

This way importpass gets set only once.

HTH,

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


  • Follow-Ups:
    • Re: global variables
      • From: Isaac Ordonez <email@hidden>
References: 
 >global variables (From: Isaac Ordonez <email@hidden>)

  • Prev by Date: Re: global variables
  • Next by Date: Re: A funny think happened...
  • Previous by thread: Re: global variables
  • Next by thread: Re: global variables
  • Index(es):
    • Date
    • Thread