Re: Script application "bundles" that are read-only: error when quitting
Re: Script application "bundles" that are read-only: error when quitting
- Subject: Re: Script application "bundles" that are read-only: error when quitting
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 17 Jul 2005 20:41:52 -0700
- Thread-topic: Script application "bundles" that are read-only: error when quitting
On 7/17/05 7:23 PM, "Stephen Jonke" <email@hidden> wrote:
> Is this a known bug? If a script application was saved as an
> "Application bundle" and then the script is run with read-only
> privileges, you get an error at quit saying that it can't save
> changes to the script. Specifically:
>
>> -5000: Could not save changes to this script because you do not
>> have the necessary access privileges
>
> If the script is saved instead as an "application" (not a bundle),
> you don't get this error message, instead it just doesn't save
> changes to properties at quit. That's the behavior I want. Is there
> any way to work around this issue for application bundles? I want to
> use a bundle so I can have a real icon, version information in Get
> Info, etc, but now if a user without write privileges to the script
> application bundle runs it, they get this error at quit.
>
> Note that I tried putting "ignoring application responses" around a
> "continue quit" statement in a quit handler, but this didn't work.
> Nor did "try".
Are there any script properties that need to be saved between script runs?
If so, consider making a preferences file and save them there instead. It
could be a .plist file using 'do shell script "defaults write"', or you can
just save them in a file using 'write' standard addition and read them back.
Then go through your script, finding every variable you have set at the top
level. Either declare them all as local at the top of the script, or put the
entire top level into a subroutine you call in a single line, since in
subroutines all variables are local by default. Unlike properties, globals
and top-level variables (which are actually a sort of global), local
variables are not saved when a script quits, so nothing is changed and you
shouldn't get that error.
--
Paul Berkowitz
_______________________________________________
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