On Dec 23, 2015, at 12:08, S. J. Cunningham <email@hidden> wrote:
I find myself needing to do the same thing in script after script so I have developed my own template as a "starter".
______________________________________________________________________
Hey Steve,
I have 4 libraries attached to all of my new scripts in Script Debugger, and these contain somewhere in the neighborhood of 150 handlers.
Then I use the SD text-expansion mechanism to enter select handlers with <tab> parameters at need.
I also use this for ASOGS (all sorts of good s#$t).
I export all of my handler calls to Typinator (with a script), so I can quick-search them.
Finally I have a script to "export" the front script with complete handlers, so it's easier to share stuff.
I have just a few purpose-specific templates in the Template system.
Here are my most used Satimage.osax handlers:
-------------------------------------------------------------------------------------------
cng("regex", "into", _src) of me fnd("_find", _data, true, true) of me fndUsing("_find", "_capture", _data, true, true) of me fndBool("_find", _data, false, false) of me
------------------------------------------------------------------------------------------- --» HANDLERS ------------------------------------------------------------------------------------------- on cng(_find, _replace, _data) change _find into _replace in _data with regexp without case sensitive end cng ------------------------------------------------------------------------------------------- on fnd(_find, _data, _all, strRslt) try find text _find in _data all occurrences _all string result strRslt with regexp without case sensitive on error return false end try end fnd ------------------------------------------------------------------------------------------- on fndUsing(_find, _capture, _data, _all, strRslt) try set findResult to find text _find in _data using _capture all occurrences _all ¬ string result strRslt with regexp without case sensitive on error false end try end fndUsing ------------------------------------------------------------------------------------------- on fndBool(_find, _data, _all, strRslt) try find text _find in _data all occurrences _all string result strRslt with regexp without case sensitive return true on error return false end try end fndBool -------------------------------------------------------------------------------------------
In any given script on my system you'll only see the top and not the handlers section (because of the libraries).
I entered all the handler calls with text-expansions and then used my export script to create the complete (flattened) script you see above in a blink.
I'll read through your template again more carefully later this evening.
|