Re: Design Report for Scripts?
Re: Design Report for Scripts?
- Subject: Re: Design Report for Scripts?
- From: "S. J. Cunningham" <email@hidden>
- Date: Fri, 20 Nov 2015 15:17:32 -0500
On Nov 20, 2015, at 2:26 PM, Stan Cleveland wrote:
>> On Nov 20, 2015, at 02:12 AM, S. J. Cunningham <email@hidden> wrote:
>>
>> I need an app to audit my scripts. In particular I would like something which prepares a Design Report showing all handlers and lists any external properties they use and conversely, shows for each property and global which handlers use them and which are declared but never used. Probably other things too. Something like what File Maker's Design Report does.
>>
>> I though't I'd ask if anyone has or knows of one before i invest time in writing my own.
>
> Hi Steve,
>
> Smile[1], the free AppleScript programming environment from Satimage, has a 'validate' command. This command will, according to them, "find undefined variables (you made a typo) and unused variables (you forgot something)." While this falls far short of your very-ambitious ideas, it IS a starting point. I must commend Satimage for achieving something that’s niether simple nor easy.
>
> I work primarily with Script Debugger[2], so have written a script that grabs the frontmost Debugger script, invokes the Smile 'validate' command and parses the result to generate a report that includes the line numbers in which errant variables appear. It could probably be repurposed to work with Script Editor, rather than Debugger. If anyone would like a copy of it let me know off list. (If I get many requests, I may just post it here to save time.)
>
> Steve, I wish you well in your Design Report project—it’s a worthy, if difficult, goal. I, and others here, will be interested to see what you come up with.
Hmm. I'm thinking it wouldn't be that difficult. Famous last words :) I have been working on a project now for several months which I thought would take several weeks. The Mythical Man Month. I'm thinking I can just slap the script into a scriptable text editor like Tex-Edit Plus and manipulate it there:
-- Find all the "property" , "global", and "on" keywords
-- Scan through each handler looking for each property or global
-- Keep track of which appear and, by elimination, which don't
-- Format a nice report with the text editor
Sounds easy… Right?
Steve
------------------
OS X 10.6.8, AppleScript 2.1.2
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden