Re: Date Modified
Re: Date Modified
- Subject: Re: Date Modified
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 22 Feb 2004 11:40:12 -0800
On 2/22/04 11:12 AM, "Doug McNutt" <email@hidden> wrote:
>
At 10:14 -0800 2/22/04, Paul Berkowitz wrote:
>
> All top-level variables (variables defined in the top-level of a script, the
>
> implicit or explicit run handler) not explicitly declared local, are
>
> actually globals aside form the scope issue (they're not recognized within
>
> subroutines as globals). But they do get retained between runs, as all
>
> globals do, just like properties. That means that their value at the end of
>
> a script run is different than at the beginning, generally, so the script
>
> has been modified.
>
>
1) Is there any other software that does such a thing? Perhaps there ought to
>
be a consumer warning way up front to publicize the unusual - and I don't mean
>
to imply bad - behavior. It's a bit like a preference file but more
>
clandestine.
>
>
2) I take note that when a script is placed into an applications script menu -
>
Eudora and BBEdit in particular - it typically does not get a new date every
>
time it is used. That may be because the application is not cooperating with
>
AppleScript "rules" or it may be deliberate so that the application itself
>
behaves as it thinks it should. It's not clear if a "property" of such a
>
script is retained between multiple invocations while the parent application
>
remains open. That may depend on the behavior of the underlying system
>
framework that applications use to execute AppleScripts. (I have wondered if
>
one can give a value to a named property in one application and then use it in
>
another.)
There's been a change in Panther compiled scripts as made by Script Editor
2.0 (but not by other script editors such as Smile and Script Debugger).
Properties are somehow saved differently in the Data Fork than in Jaguar
Script Editor 1.9. A few script menus - I believe they include Tex-Edit
Plus, BBEdit, and it sounds like Eudora as well - have made the change too.
Some app script menus - like Entourage - no longer retain changes is script
properties: they are always the initial values. I believe that Apple has
provided APIs to help applications adapt the new methods. But it's tricky
for an app that wants to go on supporting Jaguar as well as Panther - the
APIs are only for Panther. It may be that some of the apps which have
adapted have rolled their own - as apps had to do at the last change
(Jaguar) when Script Editor compiled scripts were changed form Resource Fork
to Data Fork.
All this is just to say that compiled scripts saved by Script Editor 2.0
treat properties differently now, so script menus which can run them will
reflect that. It looks as if one of the things which has changed - from what
you're saying - is that changed properties are no longer affecting the
"cleanliness" of the script - they're not being perceived as modifying the
file itself. I guess that's the direction things are going. I wonder if this
will eventually apply also to script applications - I bet it will apply to
packaged applications.
When this issue first came up here, I vaguely recall Chris Nebel speculating
that maybe some day the idea of retained script properties will go away.
*That's already the case for AppleScript Studio apps, of course) and that we
might be thinking of saving values to external user defaults instead. I
think that would be pretty good, myself. I wonder how it will work for
compiled scripts as opposed to script applications - I guess they'd have to
have prefs files just like applications do.
--
Paul Berkowitz
_______________________________________________
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.