What gives with Applescript in Tiger 10.4.7?
There used to be a description preamble at the top of the script where I could keep a brief history of script changes. Now there’s a “Description” button at the bottom. But the information here won’t print with the file.
I also used to be able to print the file name & current date at the top of the script printout.
No longer there.
Is Apple trying to kill Applescript???
Yeah, that sucks. I guess you could use an AppleScript to get the description and the script and format them in Textedit or something. You can get those from the Script Editor document:
document‚n [inh. document; see also Standard Suite] : A script document.
contains windows; contained by application, application.
contents (text) : The contents of the document.
description (text) : The description of the document.
language (language) : The scripting language.
selection (selection-object) : The current selection.
text (text) : The text of the document.
The general trend I see, though, is that folks embody those things as properties at the top of the script:
property Description : "This script calculates pi to 72 decimal places"
property ScriptVersion : "1.2.3"
property Author : "James T. Carbuncle"
That way you can get them from another script by loading this one.
Sorry, Jack, but I don’t know what you’re talking about.
I do know that Script Editor prints comments though.
Bruce doesn’t remember OS 9, Jack!
Bruce, in the “good old days,” when you printed something from script editor, the “description” was also printed at the top of the first page. It was just a much nicer format for the printed script and many of us used the fact that it printed that way to put information about the script in the Description that we might need, like the date of the last edit.
I’m afraid not. That sounds like a nice feature though.
Apple themselves get around this by using a comment block at the top of their scripts like this:
Replace Text In Item Names
Copyright © 2001 Apple Computer, Inc.
You may incorporate this Apple sample code into your program(s) without
restriction. This Apple sample code has been provided "AS IS" and the
responsibility for its operation is yours. You are not permitted to
redistribute this Apple sample code as "Apple sample code" after having
made changes. If you're going to redistribute the code, we require
that you make it clear that the code was descended from Apple sample
code, but that you've made changes.
Of course, you could write a script to create a new script file and dump in your own comment at the beginning. And you could write a script to automatically add the “last edited” date to the header when you revise the code.
It’s a hassle, but time marches on and the old features aren’t likely to return.
These also were features in Applescript in Jaguar.
I especially liked the capability to print the filename and date automatically at the top of the first page. There are very few things I hate more than to have several printouts, and not know which one was the latest without reading the script.
So I guess comments at the top of the document are the only way to go now.