• 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
persistence of script properties
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

persistence of script properties


  • Subject: persistence of script properties
  • From: Donald Hall <email@hidden>
  • Date: Sat, 5 Mar 2005 00:18:00 -0700

Title: persistence of script properties
I thought that script properties that were changed when a compiled script was run were saved by the 'store script' command, but this does not seem to be the case. My reading of Goodman and Neuburg both lead me to believe that when I load a script, run it in a way that changes its properties, then store it, then reload it and run it again, the changed values of the properties should be there. Here is my example:

-- script runner

property theScriptAlias : ""

if theScriptAlias = "" then
        set theScriptAlias to choose file of type {"osas"} -- choose file containing my test script below
end if
set theScript to load script theScriptAlias
run script theScript
display dialog "after run: theScript's x is " & theScript's x
store script theScript in theScriptAlias replacing yes
-- end of script runner
-- test script
property x : 0

set x to x + 1

activate me
display dialog "x is " & x
-- end of test script

I set theScriptAlias to be the file containing my test script.
The test script runs, displaying "x is 1".
Then I get "after run: theScript's x is 0", not '1' as I would expect.

Of course, when I rerun my script runner, I still get "x is 1", not "x is 2", which I would have gotten if 'x' had been saved by 'store script'.

Can anyone explain this?

Thanks,

Don
--
Donald S. Hall, Ph.D.
Apps & More Software Design, Inc.
email@hidden
http://www.appsandmore.com
 _______________________________________________
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

  • Follow-Ups:
    • Re: persistence of script properties
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Re: question about iPhoto scripting
  • Next by Date: The displayed name weird behaviour...
  • Previous by thread: os x mail applescript
  • Next by thread: Re: persistence of script properties
  • Index(es):
    • Date
    • Thread