• 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: "Store Script" Command
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "Store Script" Command


  • Subject: Re: "Store Script" Command
  • From: John Delacour <email@hidden>
  • Date: Sun, 6 Oct 2002 12:20:37 +0100
  • Mac-eudora-version: 5.3 alpha

At 5:34 pm -0500 5/10/02, Jeffrey Berman wrote:

The script works fine when run from within the Script Editor. However, if I
make and run the script as an Applet or run it as a compiled script from the
Script Menu, the data in the file specified on the "store script" command is
never updated with current values.

I have used comparable syntax on earlier versions of the OS, but this is the
first time with OS 10.2.1. Is there something I should be doing differently
or is this a known problem with the Jaguar version?



There certainly seems to be a problem. The script below does work from Script Menu. I am using Smile. If you are using Script Editor, make sure the scripts' windows are closed or things won't work in Script Menu.

But while getting this to work, I have encountered problems with open files and with the script updating in Script Menu but not in Smile etc. So it works, but I haven't got to the bottom of it all.



script prefs_
property reco : {}
end script
set scriptPath to "" & (path to current user folder) & "test3.scpt"
try
alias scriptPath -- test for existence
on error
store script prefs_ in file scriptPath with replacing
end try

set query to display dialog "
Enter a value for key:test" default answer "succeeded"
set val to text returned of query
set prefs to {test:val}

set imported to load script alias scriptPath

tell imported to set its reco to my prefs
store script imported in alias scriptPath with replacing

set imported to load script alias scriptPath
tell imported to set testresult to get test of its reco
store script imported in alias scriptPath with replacing
display dialog "test:" & "\"" & testresult & "\""
_______________________________________________
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: "Store Script" Command
      • From: Jeffrey Berman <email@hidden>
References: 
 >"Store Script" Command (From: Jeffrey Berman <email@hidden>)

  • Prev by Date: Re: 'sort' command-alternative?
  • Next by Date: Re: top <rant-rant-rant-rant-rant> [you were warned;p]
  • Previous by thread: "Store Script" Command
  • Next by thread: Re: "Store Script" Command
  • Index(es):
    • Date
    • Thread