@DanThomas and I have been discussing this in other topics.
I just had an idea I want to share with everyone, and get your feedback.
First, rather than calling this "Attribution", I propose to call it "ReleaseNotes" which includes the attribution info. "Attribution" is too limited a term, IMO.
So, I have this draft form, that uses a KM Action "Set Variable" instead of a "Comment" Action:
I like the "Set Variable" action because it makes that information available ( in the KM Variable "ReleaseNotes") to other Actions and sub-macros to use or display if needed.
As Dan and I have discussed, putting the version into in the "name" of the Action makes it more unlikely to be changed (accidentally or otherwise) by users who download the macro.
If we use a standard format for this name, and Macro Master Dan can figure out how to read the Action Name from script, then I think we have a good approach.
I like the idea, but I’m not thrilled with using “Set Variable”. This is exactly what Comments are for, IMO.
“Release Notes” is a good name, but I’m not that concerned with what we call it. I can use regexes to determine if something has version info in the Name.
I agree, in general. But I just had this case where I wanted to display the ReleaseNotes to the user. If these are in a Comment, then I have to duplicate them in a Set Variable or Display Text action. Unless you have some other idea?
Not really. In that case, I'd consider still using a comment with the version in the name, but the rest of it could say "see the "Set Variable" below for more information", or something like that.
I don’t want to use Variables for this purpose as a standard. That’s not what they’re for.
If you want to do it on an individual basis, well, they’re more “guidelines” than “rules”, so that’s cool.
And if I write code to parse for version information, I suppose I could look in Set Variable actions also.
But I’m strongly opposed to use Set Variable for documentation. There’s this thing called “code smell”. And no, I’m not saying you smell, or your ideas smell. It’s a term programmers use for things that just don’t feel right. And this is one of those things that just has a “smell” to it, to me.
Of course, you’ve changed my mind before, so who knows, but that’s how I feel right now.
That's a new term for me. But I get your point -- it just doesn't feel right.
However, in my experience, putting program information in variables is hardly new. I'm using "variable" here in the broadest sense to include properties, resources, support files, etc, that at some point the software may need to display to the user.
There are some very common use cases on the Mac:
File > Get Info
App > About
App > Release Notes
Help > lots of stuff
I've been using AppleScript script properties for this purpose for a long time:
Since these are at the top of the script, they serve the purpose of internal header comments. But then, if an error occurs, I can display these properties to help the user clearly identify where the error came from.
In fact, AppleScript has a built-in property called "version", which I should really set. Other scripts can get the version of another script without opening that script.
Don't most Windows apps have a similar approach?
So, my thought is that sometimes we might want to display Release Notes to the user. If we don't put that in a variable, how would we do it?
I hope I’m close to releasing my first version of an installer - been working on it for weeks. I say “hope” because I keep thinking of little tweaks to make it work better. Like version checking, LOL.
Most macros won’t need an installer. But for macros that have Resources, and certain kinds of updated macros, I think it will be helpful. We’ll see.
When using Chrome, if I want to include an image in a post, I just paste it into the post.
But Safari doesn’t support this, right? So that means people who want to include an image have to save it to disk first.
But in the KM Editor, the Edit->Copy As->Copy as Image only copies it to the clipboard. So how do people who use Safari use the copied image?
If all my prior assumptions are correct, then it would seem to me that creating a macro to automate this might be incredibly useful. Sounds like you’re the man for the job!