On Jul 28, 2011, at 10:21, Zavatone, Alex wrote:
I've been using the Script Debugger for quite some time now and am pretty impressed with the actual debugger (though it can get slow at times).
What do you all prefer? Are there other little OSAXes or other tools to make our lives easier?
I use the Satimage.osax's regex to do key-value lookups. It's very fast and flexible:
------------------------------------------------------------------------------------------------
# Find Handler - Returns Specified String - Satimage.osax MODIFIED 2011-04-17 : 16:33
------------------------------------------------------------------------------------------------
on fndUsing(fndStr, returnStr, dataSource, caseSensitive, regExFlag, wholeWord, allOccurrences, stringResult)
try
set findResult to find text fndStr ¬
in dataSource ¬
case sensitive caseSensitive ¬
regexp regExFlag ¬
whole word wholeWord ¬
using returnStr ¬
all occurrences allOccurrences ¬
string result stringResult
return findResult
on error # errMsg number errNum
return false
end try
end fndUsing
------------------------------------------------------------------------------------------------
set lookupTableData to "
------------------------------
key1 value1
key2 value1
key3 value3
------------------------------
"
fndUsing
("^key2\\t+(.+)", "\\1", lookupTableData
, false, true, false, false, true)