• 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: Isaac Ordonez <email@hidden>
  • Date: Wed, 26 May 2004 18:08:18 -0700

BINGO! I got it now. Since i'm doing an on clicked handler everything else in the script isn't called unless told to. I moved the
set importpass to my keychainpass("password") as string

inside the on clicked handler and kept the on keychainpass outside and it worked fine. Thanks a ton.

Isaac Ordonez
Technology Support Specialist II
San Rafael City Schools
415.302.8114

On May 26, 2004, at 2:46 PM, Helmut Fuchs wrote:

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.
_______________________________________________
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: 
 >global variables (From: Isaac Ordonez <email@hidden>)
 >Re: global variables (From: Helmut Fuchs <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