• 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
property persistence problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

property persistence problems


  • Subject: property persistence problems
  • From: "Donald S. Hall" <email@hidden>
  • Date: Sun, 20 May 2001 00:54:56 -0600

Hi all,

I have run into the above problem and I hope someone here can help out.

Here is my test script, compiled as an applet (AS 1.6):

------------------------------------------------------------------------
property fileRef : ""

on run -- explicit run handler because I want to use a paramterized
script eventually

if fileRef = "" then set fileRef to choose file with prompt ,
"Where is your file?"

delay 2

-- do some stuff here with the file eventually

beep 2 -- to let us know something happened

delay 2 -- give the beeps a chance to be heard

end run
------------------------------------------------------------------------

1. Running this script from the Finder after a fresh save leads to
persistence of the fileRef property - no choose file dialog on 2nd run.

2. Once persistence of property is established by 1., running the script
from a second (compiled) script:

run script file "persistence test"

maintains persistence - no choose file dialog appears.

3. Doing a fresh save of the applet, then running it as in 2. results in no
persistence - the choose file dialog appears every time.

It seems that to establish persistence of the property, the script must
first be run directly from the Finder. This means that a script with a
parameterized run handler can never hold an altered property since there is
no way to pass parameters to it from the Finder - you must run it from
another script such as:

run script file "persistence test" with parameters {whatever}

Does anyone have a way around this or an explanation?

Thanks,

Don

--
Donald S. Hall, Ph.D.
Apps & More Software Design, Inc.
http://www.theboss.net/appsmore
email@hidden


  • Prev by Date: Setting the text in a note in Now Contact
  • Next by Date: Re: Calling handlers by reference
  • Previous by thread: Re: Setting the text in a note in Now Contact
  • Next by thread: Re: Scope of globals, parents and children, "load script" and all that
  • Index(es):
    • Date
    • Thread