---------------------------------------------------------------------
# Created: 2012-09-14 : 06:55
# Modified: 2012-09-14 : 08:04
# Application: Script Debugger
# Purpose: Find the next Marker
# Dependencies: Satimage.osax
---------------------------------------------------------------------
on fnd(findStr, srcData, startPos, caseSensitive, allOccurrences, stringResult)
try
set findResult to find text findStr in srcData ¬
starting at startPos ¬
case sensitive caseSensitive ¬
all occurrences allOccurrences ¬
string result stringResult ¬
with regexp
return findResult
on error
return false
end try
end fnd
---------------------------------------------------------------------
on fndBool(findStr, srcData, caseSensitive, allOccurrences, stringResult)
try
set findResult to find text findStr in srcData ¬
case sensitive caseSensitive ¬
all occurrences allOccurrences ¬
string result stringResult ¬
with regexp
return true
on error
return false
end try
end fndBool
---------------------------------------------------------------------
try
set _mark to "--»"
tell application "Script Debugger"
if document 1 exists then tell document 1
set _SRC to source text
if (fndBool(_mark, _SRC, false, false, false) of me) = true then
try
set {startPos, null} to character range of selection
set fRec to fnd(_mark, _SRC, startPos, false, false, false) of me
if fRec ≠ false then
set selection to {(matchPos of fRec) + 1, matchLen of fRec}
else
set startPos to 0
set fRec to fnd(_mark, _SRC, startPos, false, false, false) of me
set selection to {(matchPos of fRec) + 1, matchLen of fRec}
end if
end try
end if
end tell
end tell
on error eMsg number eNum
# stdErrAS(eMsg, eNum, true, true) of me
stdErrAS(eMsg, eNum, true, false) of me
end try
---------------------------------------------------------------------